public NetConnection GetClient(ClientValue cv) { foreach (KeyValuePair<ClientValue, NetConnection> kv in this.ConnectedClients) { if (kv.Key.Equals(cv)) return kv.Value; } return null; }
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); } }
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; }