• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to get client ip from socket

 
Isaac Jones
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
i've been trying to find out how to get the clients ip all day long now. i hope someone can help me here. i have a serverSocket running on my server. in a while loop i have a socket=serverSocket.accept() waiting for clients to connect. how can i find out the clients ip? shouldn't it be in the socket? i've tried several different functions but all i get is the ip of my server. anyone got any ideas?
here is part of my code:



thanks, sgl
 
Joe Ess
Bartender
Posts: 9313
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Socket.getRemoteSocketAddress()
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic