Пример #1
0
        public static IServer CreateTcpServer(NetConfig config, IServerHandler handler, IPacket packet)
        {
            TcpServer server = new TcpServer(config);

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