• Post Reply Bookmark Topic Watch Topic
  • New Topic

Detecting IP address  RSS feed

 
Jonk kulsh
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do i get the IP addresses of other computers that is connected to my computer.If possible give some code.

the code below is not working

Socket socket = new ServerSocket ().accept ();
System.out.println ("Client from " + socket.getInetAddress().getHostAddress());

thnx
[ February 09, 2005: Message edited by: Jonk kulsh ]
 
Frank Nielsen
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
on the Socket that ServerSocket provides on accept(), call getRemoteSocketAddress()..

Check java Doc v1.4 for Sockets
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!