My client pc is connected to as server pc via sockets over Ethernet, How do I find the IP of this client from the server side code.
The server is dishing out one socket
I think you might be looking for the getInetAddress method of the Socket object.
Use getRemoteSocketAddress() instead.
Use this code :
String ip=(((InetSocketAddress) socket.getRemoteSocketAddress()).getAddress()).toString().replace("/","");
I believe you want to use the remote address instead:
csocket.getRemoteSocketAddress().toString();