Exemple #1
0
 public NetConnection GetClient(ClientValue cv)
 {
     foreach (KeyValuePair<ClientValue, NetConnection> kv in this.ConnectedClients)
     {
         if (kv.Key.Equals(cv))
             return kv.Value;
     }
     return null;
 }
Exemple #2
0
 public void SendToClient(ClientValue cv, MMCMessage message)
 {
     foreach (KeyValuePair<ClientValue, NetConnection> kv in this.ConnectedClients)
     {
         if (kv.Key.Equals(cv))
             this.SendMessage(message, kv.Value);
     }
 }
Exemple #3
0
 public NetConnection Connect(ClientValue remoteEndPoint, NetOutgoingMessage hailMessage)
 {
     NetConnection connection = null;
     try
     {
         connection = base.Connect(remoteEndPoint.Key, hailMessage);
         ConnectedClients.Add(new KeyValuePair<ClientValue, NetConnection>(remoteEndPoint, connection));
     }
     catch (Exception e)
     {
         //If exception is raised no insert
     }
     return connection;
 }