/// <summary> /// Constructs and initializes an ONC/RPC client object, which can /// communicate with the portmapper at the given host using the /// speicified protocol. /// </summary> /// <remarks> /// Constructs and initializes an ONC/RPC client object, which can /// communicate with the portmapper at the given host using the /// speicified protocol. /// </remarks> /// <param name="host">Host where to contact the portmapper.</param> /// <param name="protocol"> /// Protocol to use for contacting the portmapper. This /// can be either <code>OncRpcProtocols.ONCRPC_UDP</code> or /// <code>OncRpcProtocols.ONCRPC_TCP</code> (HTTP is currently /// not supported). /// </param> /// <param name="timeout"> /// Timeout in milliseconds for connection operation. This /// parameter applies only when using TCP/IP for talking to the /// portmapper. A negative timeout indicates that the /// implementation-specific timeout setting of the JVM and java.net /// implementation should be used instead. /// </param> /// <exception cref="OncRpcException">if an ONC/RPC error occurs.</exception> /// <exception cref="System.IO.IOException">if an I/O error occurs.</exception> /// <exception cref="org.acplt.oncrpc.OncRpcException"></exception> public OncRpcPortmapClient(IPAddress host, int protocol, int timeout) { switch (protocol) { case org.acplt.oncrpc.OncRpcProtocols.ONCRPC_UDP: { portmapClient = new org.acplt.oncrpc.OncRpcUdpClient(host, PMAP_PROGRAM, PMAP_VERSION , PMAP_PORT, false); break; } case org.acplt.oncrpc.OncRpcProtocols.ONCRPC_TCP: { portmapClient = new org.acplt.oncrpc.OncRpcTcpClient(host, PMAP_PROGRAM, PMAP_VERSION , PMAP_PORT, 0, timeout, false); // default buff size break; } default: { throw (new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_UNKNOWNPROTO )); } } }
/// <summary> /// Construct a new <code>OncRpcClientStub</code> which uses the given /// client proxy object for communication with a remote ONC/RPC server. /// </summary> /// <remarks> /// Construct a new <code>OncRpcClientStub</code> which uses the given /// client proxy object for communication with a remote ONC/RPC server. /// </remarks> /// <param name="client"> /// ONC/RPC client proxy object implementing a particular /// IP protocol. /// </param> /// <exception cref="org.acplt.oncrpc.OncRpcException"></exception> /// <exception cref="System.IO.IOException"></exception> public OncRpcClientStub(org.acplt.oncrpc.OncRpcClient client) { this.client = client; }
/// <summary> /// Close the connection to an ONC/RPC server and free all network-related /// resources. /// </summary> /// <remarks> /// Close the connection to an ONC/RPC server and free all network-related /// resources. Well -- at least hope, that the Java VM will sometimes free /// some resources. Sigh. /// </remarks> /// <exception cref="OncRpcException">if an ONC/RPC error occurs.</exception> /// <exception cref="org.acplt.oncrpc.OncRpcException"></exception> public virtual void close() { if (client != null) { try { client.close(); } finally { client = null; } } }
/// <summary> /// Construct a new <code>OncRpcClientStub</code> for communication with /// a remote ONC/RPC server. /// </summary> /// <remarks> /// Construct a new <code>OncRpcClientStub</code> for communication with /// a remote ONC/RPC server. /// </remarks> /// <param name="host">Host address where the desired ONC/RPC server resides.</param> /// <param name="program">Program number of the desired ONC/RPC server.</param> /// <param name="version">Version number of the desired ONC/RPC server.</param> /// <param name="protocol"> /// /// <see cref="OncRpcProtocols">Protocol</see> /// to be used for /// ONC/RPC calls. This information is necessary, so port lookups through /// the portmapper can be done. /// </param> /// <param name="useSecurePort">The local binding port will be less than 1024.</param> /// <exception cref="OncRpcException">if an ONC/RPC error occurs.</exception> /// <exception cref="System.IO.IOException">if an I/O error occurs.</exception> /// <exception cref="org.acplt.oncrpc.OncRpcException"></exception> public OncRpcClientStub(IPAddress host, int program, int version, int port, int protocol, bool useSecurePort) { client = org.acplt.oncrpc.OncRpcClient.newOncRpcClient(host, program, version, port , protocol, useSecurePort); }
/// <summary> /// Construct a new <code>OncRpcClientStub</code> which uses the given /// client proxy object for communication with a remote ONC/RPC server. /// </summary> /// <remarks> /// Construct a new <code>OncRpcClientStub</code> which uses the given /// client proxy object for communication with a remote ONC/RPC server. /// </remarks> /// <param name="client"> /// ONC/RPC client proxy object implementing a particular /// IP protocol. /// </param> /// <exception cref="org.acplt.oncrpc.OncRpcException"></exception> /// <exception cref="System.IO.IOException"></exception> public OncRpcClientStub(org.acplt.oncrpc.OncRpcClient client) { this.client = client; }