/// <summary> /// Register an ONC/RPC with the given program number, version and protocol /// at the given port with the portmapper. /// </summary> /// <remarks> /// Register an ONC/RPC with the given program number, version and protocol /// at the given port with the portmapper. /// </remarks> /// <param name="program">The number of the program to be registered.</param> /// <param name="version">The version number of the program.</param> /// <param name="protocol"> /// The protocol spoken by the ONC/RPC server. Can be one /// of the /// <see cref="OncRpcProtocols">OncRpcProtocols</see> /// constants. /// </param> /// <param name="port">The port number where the ONC/RPC server can be reached.</param> /// <returns> /// Indicates whether registration 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 setPort(int program, int version, int protocol, int port) { // // Fill in the request parameters. // org.acplt.oncrpc.OncRpcServerIdent @params = new org.acplt.oncrpc.OncRpcServerIdent (program, version, protocol, port); org.acplt.oncrpc.XdrBoolean result = new org.acplt.oncrpc.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(org.acplt.oncrpc.OncRpcPortmapServices.PMAP_SET, @params, result ); } catch (org.acplt.oncrpc.OncRpcException) { throw (new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_PMAPFAILURE )); } return(result.booleanValue()); }
/// <summary> /// Register an ONC/RPC with the given program number, version and protocol /// at the given port with the portmapper. /// </summary> /// <remarks> /// Register an ONC/RPC with the given program number, version and protocol /// at the given port with the portmapper. /// </remarks> /// <param name="program">The number of the program to be registered.</param> /// <param name="version">The version number of the program.</param> /// <param name="protocol"> /// The protocol spoken by the ONC/RPC server. Can be one /// of the /// <see cref="OncRpcProtocols">OncRpcProtocols</see> /// constants. /// </param> /// <param name="port">The port number where the ONC/RPC server can be reached.</param> /// <returns> /// Indicates whether registration 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 setPort(int program, int version, int protocol, int port) { // // Fill in the request parameters. // org.acplt.oncrpc.OncRpcServerIdent @params = new org.acplt.oncrpc.OncRpcServerIdent (program, version, protocol, port); org.acplt.oncrpc.XdrBoolean result = new org.acplt.oncrpc.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(org.acplt.oncrpc.OncRpcPortmapServices.PMAP_SET, @params, result ); } catch (org.acplt.oncrpc.OncRpcException) { throw (new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_PMAPFAILURE )); } return result.booleanValue(); }