if (protocol.equals("compression")) {
System.out.println("using compression sockets");
return new CompressionServerSocket(port);
} else if (protocol.equals("xor")) {
System.out.println("using xor sockets");
if (data == null || data.length != 1)
throw new IOException("invalid argument for XOR protocol");
return new XorServerSocket(port, data[0]);
}
System.out.println("using default socket protocol");
return defaultFactory.createServerSocket(port);