//starts client public void Run() { mClientForm = new ClientForm(this); //sets up new thread Thread threads = new Thread(ProcessServerResponse); threads.Start(); mClientForm.ShowDialog(); }
private void InitClient(PacketHeader packetHeader, Connection connection, string serverIp) { string address = (connection.ToString().Split('>').Last()).Split('(').First(); Debug.Print(String.Format(".{0}.\n", address)); string clientIP = address.Split(':').First().Replace(" ", ""); Debug.Print(String.Format(".{0}.\n", clientIP)); int clientPort = int.Parse(address.Split(':').Last()); Debug.Print(String.Format(".{0}.\n", clientPort.ToString())); ClientForm clientForm = new ClientForm(clientIP, clientPort, serverIp); clientsForms.Add(new Tuple <string, ClientForm>(clientIP + clientPort.ToString(), clientForm)); clientForm.ShowDialog(); }