public static IServerClient CreateClient(IServerListener listeners, Protocols?proto) { IServerClient sc = null; switch (proto) { case (Protocols.Tcp): { sc = new TcpServerClient(listeners.GetClientSocket()); break; } case (Protocols.Udp): { sc = new UdpServerClient(listeners.GetClientSocket()); break; } } return(sc); }