Esempio n. 1
0
        public static void openSender(Clients clients, User user)
        {
            ThreadSender sender = new ThreadSender(clients , user);

                Thread thLis = new Thread(new ThreadStart(sender.runThreadSender));
                thLis.Start();
        }
Esempio n. 2
0
 public void newClient(User client, IPAddress clientIP)
 {
     clients.Add(client, clientIP);
 }
 public ThreadSender(Clients clientsList, User message, int port = 40404)
 {
     this.clientsList = clientsList;
     this.message = message;
     this.port = port;
 }
Esempio n. 4
0
 public IPAddress getIP(User key)
 {
     return clients[key];
 }
Esempio n. 5
0
        public static string SerializeToString(User user)
        {
            XmlSerializer serializer = new XmlSerializer(user.GetType());

            using (StringWriter writer = new StringWriter())
            {
                serializer.Serialize(writer, user);

                return writer.ToString();
            }
        }