lucifer,
When you call the Accept method, it returns a Socket instance
representing the connection. On that instance, access the RemoteEndPoint
property to get the EndPoint which represents the ip address of the remote
client.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"lucifer" <um**********@gmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
Code:
IPAddress iadd =IPAddress.Parse("192.168.1.2");
IPEndPoint ipe = new IPEndPoint(iadd, port);
Socket sock = new Socket(AddressFamily.InterNetwork, SocketType.Stream
,ProtocolType.Tcp);
sock.Bind(ipe);
sock.Listen(32);
sock.Accept();
sock.Connect()// problem i dont know remote ip address nor can i hard
code it
web(sock);
sock.Shutdown(SocketShutdown.Both);
sock.Close();
how can i find about the ip address of remote client