Ejemplo n.º 1
0
        internal void RemoveClient(SSLClient client)
        {
            Thread.BeginCriticalRegion();

            lock (clientList)
            {
                client.Dispose();
                clientList.Remove(client);
            }

            Thread.EndCriticalRegion();
        }
Ejemplo n.º 2
0
        public void SendIncommingP2P(string sender, string receiver, int port, string key, string ip)
        {
            SSLClient receiverClient = FindClient(receiver);

            if (receiverClient != null)
            {
                receiverClient.writer.WriteIncommingP2P(sender, port, key, ip);
            }
            else
            {
                Console.WriteLine("Error: Receiving client not in ClientList");
            }
        }
Ejemplo n.º 3
0
        public void SendSatusUpdate(string sender, string receiver, string statusUpdate, string entireMessage)
        {
            SSLClient receiverClient = FindClient(receiver);

            if (receiverClient != null)
            {
                receiverClient.writer.WriteStatusMessage(sender, receiver, statusUpdate);
            }
            else
            {
                userManager.FindUser(receiver).waitingMessages.Add(entireMessage);
                Console.WriteLine("Receiver was offline message was stored");
            }
        }
Ejemplo n.º 4
0
 //Handles messages arriving at server.
 public Messagehandler(string userName, SSLServer server, SSLClient client)
 {
     this.server = server;
     this.client = client;
 }