Beispiel #1
0
        internal void RemoveClient(SSLClient client)
        {
            Thread.BeginCriticalRegion();

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

            Thread.EndCriticalRegion();
        }
Beispiel #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");
            }
        }
Beispiel #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");
            }
        }
Beispiel #4
0
 //Handles messages arriving at server.
 public Messagehandler(string userName, SSLServer server, SSLClient client)
 {
     this.server = server;
     this.client = client;
 }