sdsu.rmi.server
Class XorRMISocketFactory
java.lang.Object
|
+--java.rmi.server.RMISocketFactory
|
+--sdsu.rmi.server.XorRMISocketFactory
- public class XorRMISocketFactory
- extends java.rmi.server.RMISocketFactory
The RMISocketFactory is used by the RMI runtime in order to obtain
client and server sockets for RMI calls. This factory creates
XorSockets and XorServerSocket, which use the byte mask given
the constructor. To use Xor Sockets in an RMI application
execute the following code before creating a remote object
on both the client and server side:
try
{
RMISocketFactory.setSocketFactory(
new XorRMISocketFactory( (byte) 0x1A ) );
}
catch (IOException factoryError )
{
System.err.println( "setSocketFactory failed: " +
factoryError );
}
Based on example found at:
http://java.sun.com/products/jdk/1.2/docs/guide/rmi/copy/rmisocketfactory.doc.html
- Version:
- 1.0 14 Feb 1998
- Author:
- Roger Whitney
(whitney@cs.sdsu.edu)
Constructor Summary |
XorRMISocketFactory(byte mask)
Create a new socket factory with the given
byte mask to be used in the XorSockets. |
Method Summary |
java.net.ServerSocket |
createServerSocket(int port)
Create a server socket on the specified port (port 0 represents
an anonymous port). |
java.net.Socket |
createSocket(java.lang.String host,
int port)
Create a client socket connected to the specified host and port. |
Methods inherited from class java.rmi.server.RMISocketFactory |
getDefaultSocketFactory,
getFailureHandler,
getSocketFactory,
setFailureHandler,
setSocketFactory |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
XorRMISocketFactory
public XorRMISocketFactory(byte mask)
- Create a new socket factory with the given
byte mask to be used in the XorSockets.
createSocket
public java.net.Socket createSocket(java.lang.String host,
int port)
throws java.io.IOException
- Create a client socket connected to the specified host and port.
- Throws:
- java.io.IOException - if an I/O error occurs.
- Overrides:
- createSocket in class java.rmi.server.RMISocketFactory
createServerSocket
public java.net.ServerSocket createServerSocket(int port)
throws java.io.IOException
- Create a server socket on the specified port (port 0 represents
an anonymous port).
- Throws:
- java.io.IOException - if an I/O error occurs.
- Overrides:
- createServerSocket in class java.rmi.server.RMISocketFactory