How to solve the "Control.Invoke must be used to interact with controls created on a separated thread" Error Exception
Socket serverSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
serverSocket.Bind(new IPEndPoint(IPAddress.Loopback, portNo));
serverSocket.Listen(5);
Socket client = serverSocket.Accept();
MessageBox.Show("Client Connected");
//Sent to Client
NetworkStream ns = new NetworkStream(client);
StreamWriter writer = new StreamWriter(ns);
writer.AutoFlush = true;
writer.WriteLine(sb.ToString());
//Receive from Client NetworkStream
Stream nets = new NetworkStream(client);
StreamReader reader = new StreamReader(nets);
string clientIPAddress = reader.ReadLine();