Exemple #1
0
 private TcpTalk GetTalker(string connectionId, TcpAddress destination)
 {
     lock (_talkers)
     {
         TcpTalk talker;
         if (!_talkers.TryGetValue(connectionId, out talker))
         {
             talker = new TcpTalk(_port, destination);
             talker.HandleMessage(HandleMessage);
             _talkers[connectionId] = talker;
         }
         return talker;
     }
 }
Exemple #2
0
 private void NewClientConnection(TcpClient client)
 {
     lock (_talkers)
     {
         var talker = new TcpTalk(client);
         talker.HandleMessage(HandleMessage);
     }
 }