Member Avatar for kubiak

Hi, i have csharp server(console application) and java client. I need to get a java client ipaddress, can someone tell me what is the function in csharp? I am new in csharp. I was searching on web and nothing help me.

Recommended Answers

All 2 Replies

you could always call netstat. that'll give you the ip of every machine connected to yours, and also the stat of that connection.

You can obtain the client IP address with the following call:

string clientConnection = ((IPEndPoint)tcpClient.Client.RemoteEndPoint).Address.ToString();

where tcpClient is your TCPClient object.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.