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);