Ejemplo n.º 1
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");
        }