예제 #1
0
        public void SetupCommunicationWith(TcpClient tcpClient)
        {
            //tcpClient.NoDelay = true;
            Node client = clientNodeFactory.Create(logger, tcpClient);

            clients.Add(client);
            clientCommunicationInitializer.SetUpCommunicationWith(client);
        }
예제 #2
0
        private void startListeningForMessagesInANewThread()
        {
            messageListener.OnMessageReceived += onMessageReceived;

            serverNode = clientNodeFactory.Create(logger, tcpClient);
            logger.Write <Client>("Starting listening for messages in a new thread...");
            Task.Factory.StartNew(() =>
            {
                messageListener.ListenForMessages(serverNode);
            });
            logger.Write <Client>("Starting listening for messages in a new thread... started");
        }