static TcpServerSingleton() { lazyServer = new Lazy<ServerTCP>(() => { MessageManager manager = new MessageManager(_encryptor); IPAddress ipAddress = _serverEndPoint.Address; int port = _serverEndPoint.Port; var serverTcp = new ServerTCP(ipAddress, port, manager); Task.Factory.StartNew(() => serverTcp.Listen()); return serverTcp; }); }
static TcpServerSingleton() { lazyServer = new Lazy <ServerTCP>(() => { MessageManager manager = new MessageManager(_encryptor); IPAddress ipAddress = _serverEndPoint.Address; int port = _serverEndPoint.Port; var serverTcp = new ServerTCP(ipAddress, port, manager); Task.Factory.StartNew(() => serverTcp.Listen()); return(serverTcp); }); }