Results 1 to 8 of 8

Thread: ipaddress

  1. #1
    tej
    tej is offline Member
    Join Date
    Apr 2009
    Posts
    8
    Rep Power
    0

    Default ipaddress

    hi all
    i am getting problem when i want know the incoming IP addressees
    coming from opened ports.could anybody help me ?:mad:

  2. #2
    toadaly is offline Senior Member
    Join Date
    Jan 2009
    Posts
    671
    Rep Power
    6

    Default

    Assuming you have a Socket, use "getInetAddress()' to create an InetAddress, and then "getHostAddress()" on that to get the IP of the other end.

  3. #3
    tej
    tej is offline Member
    Join Date
    Apr 2009
    Posts
    8
    Rep Power
    0

    Default inetaddress

    Quote Originally Posted by toadaly View Post
    Assuming you have a Socket, use "getInetAddress()' to create an InetAddress, and then "getHostAddress()" on that to get the IP of the other end.
    thank you for replay. i am new to java could u tell me in detail.

  4. #4
    conv_bay is offline Member
    Join Date
    Apr 2009
    Posts
    15
    Rep Power
    0

    Default

    i also dont know..
    can u tell in detail

  5. #5
    toadaly is offline Senior Member
    Join Date
    Jan 2009
    Posts
    671
    Rep Power
    6

    Default

    Java Code:
    ServerSocket serverSocket = new ServerSocket(54321);
    
    Socket socket = serverSocket.accept();
    
    System.out.println("Remote IP = "+socket.getInetAddress().getHostAddress());

  6. #6
    tej
    tej is offline Member
    Join Date
    Apr 2009
    Posts
    8
    Rep Power
    0

    Default ipaddress

    actually my task is how to find the ipaddress who is chating with me in messanger .please help me

  7. #7
    OrangeDog's Avatar
    OrangeDog is offline Senior Member
    Join Date
    Jan 2009
    Location
    Cambridge, UK
    Posts
    838
    Rep Power
    6

    Default

    Ask them. MSN messenger uses intermediate servers so all user ips are hidden.
    Don't forget to mark threads as [SOLVED] and give reps to helpful posts.
    How To Ask Questions The Smart Way

  8. #8
    tej
    tej is offline Member
    Join Date
    Apr 2009
    Posts
    8
    Rep Power
    0

    Default ipaddress

    just i want to protect my pc from hackers.so here is my task i want to know the ipaddress of a hacker who want to interact with my pc in network.is it possible with java?
    Last edited by tej; 04-25-2009 at 07:16 PM.

Similar Threads

  1. IPAddress to Country
    By sandeeprao.techno in forum Advanced Java
    Replies: 2
    Last Post: 12-19-2008, 02:39 AM
  2. IPAddress or HostName
    By abhijeet_152 in forum Networking
    Replies: 1
    Last Post: 11-27-2008, 07:58 PM
  3. How to track client logout time and orignal ipaddress (not gateway) in java
    By psandeep in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 06-13-2008, 01:32 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
  •