public static void openSender(Clients clients, User user) { ThreadSender sender = new ThreadSender(clients , user); Thread thLis = new Thread(new ThreadStart(sender.runThreadSender)); thLis.Start(); }
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; }
public IPAddress getIP(User key) { return clients[key]; }
public static string SerializeToString(User user) { XmlSerializer serializer = new XmlSerializer(user.GetType()); using (StringWriter writer = new StringWriter()) { serializer.Serialize(writer, user); return writer.ToString(); } }