public void GetData() { Form1 f = new Form1(); string ipadd = getip(); IPAddress ipAd = IPAddress.Parse("192.168.0.15"); //use local m/c IP address, and use the same in the client // IPAddress ip = IPAddress.Parse(ipadd); txtip.Text = ipAd.ToString(); txtport.Text = "3030"; /* Initializes the Listener */ TcpListener myList = new TcpListener(ipAd, 3030); /* Start Listeneting at the specified port */ myList.Start(); txtdata.Text = "The server is running at port 3030..."; txtdata.Text = txtdata.Text + Environment.NewLine + "The local End point is :" + myList.LocalEndpoint; txtdata.Text = txtdata.Text + Environment.NewLine + "Waiting for a connection....."; Socket s = myList.AcceptSocket(); txtdata.Text = txtdata.Text + Environment.NewLine +"Connection accepted from " + s.RemoteEndPoint; // txtdata.Text = "Connection accepted from " + s.RemoteEndPoint; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)