コード例 #1
0
        /// <summary>Unregister an ONC/RPC with the given program number and version.</summary>
        /// <remarks>
        /// Unregister an ONC/RPC with the given program number and version. The
        /// portmapper will remove all entries with the same program number and
        /// version, regardless of the protocol and port number.
        /// </remarks>
        /// <param name="program">The number of the program to be unregistered.</param>
        /// <param name="version">The version number of the program.</param>
        /// <returns>
        /// Indicates whether deregistration succeeded (<code>true</code>)
        /// or was denied by the portmapper (<code>false</code>).
        /// </returns>
        /// <exception cref="OncRpcException">
        /// if the portmapper is not available (detail is
        /// <see cref="OncRpcException.RPC_PMAPFAILURE">OncRpcException.RPC_PMAPFAILURE</see>
        /// ).
        /// </exception>
        /// <exception cref="org.acplt.oncrpc.OncRpcException"></exception>
        public virtual bool unsetPort(int program, int version)
        {
            //
            // Fill in the request parameters.
            //
            OncRpcServerIdent @params = new OncRpcServerIdent
                                            (program, version, 0, 0);
            XdrBoolean result = new XdrBoolean(false);

            //
            // Try to contact the portmap process. If something goes "boing"
            // at this stage, then rethrow the exception as a generic portmap
            // failure exception.
            //
            try
            {
                portmapClient.call(OncRpcPortmapServices.PMAP_UNSET, @params, result
                                   );
            }
            catch (OncRpcException e)
            {
                // Temp output
                Console.Out.WriteLine(e.Message);
                Console.Out.WriteLine(e.StackTrace);
                throw (new OncRpcException(OncRpcException.RPC_PMAPFAILURE
                                           ));
            }
            return(result.booleanValue());
        }
コード例 #2
0
 /// <summary>Unregister an ONC/RPC with the given program number and version.</summary>
 /// <remarks>
 /// Unregister an ONC/RPC with the given program number and version. The
 /// portmapper will remove all entries with the same program number and
 /// version, regardless of the protocol and port number.
 /// </remarks>
 /// <param name="program">The number of the program to be unregistered.</param>
 /// <param name="version">The version number of the program.</param>
 /// <returns>
 /// Indicates whether deregistration succeeded (<code>true</code>)
 /// or was denied by the portmapper (<code>false</code>).
 /// </returns>
 /// <exception cref="OncRpcException">
 /// if the portmapper is not available (detail is
 /// <see cref="OncRpcException.RPC_PMAPFAILURE">OncRpcException.RPC_PMAPFAILURE</see>
 /// ).
 /// </exception>
 /// <exception cref="org.acplt.oncrpc.OncRpcException"></exception>
 public virtual bool unsetPort(int program, int version)
 {
     //
     // Fill in the request parameters.
     //
     OncRpcServerIdent @params = new OncRpcServerIdent
         (program, version, 0, 0);
     XdrBoolean result = new XdrBoolean(false);
     //
     // Try to contact the portmap process. If something goes "boing"
     // at this stage, then rethrow the exception as a generic portmap
     // failure exception.
     //
     try
     {
         portmapClient.call(OncRpcPortmapServices.PMAP_UNSET, @params, result
             );
     }
     catch (OncRpcException e)
     {
         // Temp output
         Console.Out.WriteLine(e.Message);
         Console.Out.WriteLine(e.StackTrace);
         throw (new OncRpcException(OncRpcException.RPC_PMAPFAILURE
             ));
     }
     return result.booleanValue();
 }