public static IServer CreateTcpServer(NetConfig config, IServerHandler handler, IPacket packet) { TcpServer server = new TcpServer(config); server.Handler = handler; server.Packet = packet; return(server); }
public TcpServer(NetConfig config) { Config = config; Name = "TCP-SERVER-" + Guid.NewGuid().ToString("N"); }
public static IServer CreateTcpServer <HANDLER>(NetConfig config) where HANDLER : IServerHandler, new() { return(CreateTcpServer(config, new HANDLER(), null)); }
public static IServer CreateTcpServer <HANDLER, IPACKET>(NetConfig config) where HANDLER : IServerHandler, new() where IPACKET : IPacket, new() { return(CreateTcpServer(config, new HANDLER(), new IPACKET())); }