示例#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();
        }
示例#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;
 }
示例#4
0
 public IPAddress getIP(User key)
 {
     return clients[key];
 }
示例#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();
            }
        }