Results 1 to 5 of 5

Thread: get client ip

  1. #1
    Ozmosis is offline Member
    Join Date
    Oct 2009
    Posts
    9
    Rep Power
    0

    Default get client ip

    i need to get the client IP n a socket connection. I need the IP alone with the port number (not using getRemoteAdress()).

    help s much appreciated

  2. #2
    mrmatt1111's Avatar
    mrmatt1111 is offline Senior Member
    Join Date
    Aug 2009
    Location
    San Jose, CA, USA
    Posts
    320
    Rep Power
    6

    Default

    Why not use getInetAddress() or the like?
    My Hobby Project: LegacyClone

  3. #3
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    In ServletRequest I'm using following, able collect lots of details.

    getRemoteAddr()
    getRemoteHost()
    getRemotePort()

    Client can be end client or the proxy.

  4. #4
    alzorz is offline Member
    Join Date
    Nov 2009
    Posts
    1
    Rep Power
    0

    Default

    borrowing the thread a little, have somewhat the same problem. But the difference is that i dont want my local IP on the computer but instead the IP that i ISP delivers to me, been searching around for quite some time and haven't found anything :/. Anyone know any good way to get it?

  5. #5
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    How about capturing the response of netstat -n within your application on Windows. In Mac OS, you can find those details in System Preference, and I couldn't remember the direct way to access it.

Similar Threads

  1. Replies: 3
    Last Post: 07-29-2009, 05:52 AM
  2. client app
    By santhu538 in forum New To Java
    Replies: 1
    Last Post: 02-28-2009, 07:54 AM
  3. Replies: 1
    Last Post: 10-05-2008, 04:12 PM
  4. UDP Client help
    By misslilbit02 in forum Advanced Java
    Replies: 0
    Last Post: 03-09-2008, 08:31 PM
  5. Identify Client in Socket Client Server Application
    By masadjie in forum Networking
    Replies: 1
    Last Post: 12-20-2007, 10:18 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •