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;
            });
        }
Esempio n. 2
0
        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);
            });
        }