LocalRMIClientSocketFactorypublic class LocalRMIClientSocketFactory extends Object implements Serializable, RMIClientSocketFactoryLocal RMI Client Socket Factory. This class creates client sockets
that connect to local loopback address. This class needs to be Serializable
because RMI stubs contain a reference to client socket factory. |
Fields Summary |
---|
private InetAddress | localLoopbackAddress |
Constructors Summary |
---|
public LocalRMIClientSocketFactory()Create a new local RMI Client Socket Factory. This method uses null
argument to InetAddress.getByName() to determine
local loopback address.
localLoopbackAddress = InetAddress.getByName(null);
| public LocalRMIClientSocketFactory(InetAddress localAddr)Create a new local RMI Client Socket Factory on specified local IP
address. Use this constructor when you know the local loopback IP
address and do not want to handle UnknownHostException thrown by default
constructor.
localLoopbackAddress = localAddr;
|
Methods Summary |
---|
public java.net.Socket | createSocket(java.lang.String host, int port)Create a new socket that connects to local loopback address and
specified port. This method ignores host parameter. The method comes
from the interface java.rmi.server.RMIClientSocketFactory
return new Socket(localLoopbackAddress, port);
|
|