FileDocCategorySizeDatePackage
MultiClientSocketFactory.javaAPI DocExample2723Wed Apr 19 11:20:16 BST 2000examples.rmisocfac

MultiClientSocketFactory

public class MultiClientSocketFactory extends Object implements Serializable, RMIClientSocketFactory

Fields Summary
private static RMISocketFactory
defaultFactory
private String
protocol
private byte[]
data
Constructors Summary
public MultiClientSocketFactory(String protocol, byte[] data)


         
	this.protocol = protocol;
	this.data = data;
    
Methods Summary
public java.net.SocketcreateSocket(java.lang.String host, int port)

	if (protocol.equals("compression")) {
	    return new CompressionSocket(host, port);
	    
	} else if (protocol.equals("xor")) {
	    if (data == null || data.length != 1)
		throw new IOException("invalid argument for XOR protocol");
	    return new XorSocket(host, port, data[0]);

	} 

	return defaultFactory.createSocket(host, port);