Results 1 to 3 of 3
  1. #1
    Mnelson is offline Member
    Join Date
    Jun 2012
    Posts
    11
    Rep Power
    0

    Default Testing UDP server

    Hi Im trying to figure out how to display the IP and port number of a client who has sent data to a server program that I wrote.

    In my server program I've been able to display my IP and my servers port number with the following code:


    Java Code:
       InetAddress myIp =InetAddress.getLocalHost();  
                 System.out.println("Listening Port: " + serverSocket.getLocalPort() );  
                 System.out.println("IP: " + myIp.getHostAddress() );

    But how would I display the information on the clients side? I need the server to show what port and IP the client is using.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,188
    Rep Power
    19

    Default Re: Testing UDP server

    Moved from New to Java

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    cselic is offline Senior Member
    Join Date
    Apr 2010
    Location
    Belgrade, Serbia
    Posts
    278
    Rep Power
    5

    Default Re: Testing UDP server

    Quote Originally Posted by Mnelson View Post
    ...But how would I display the information on the clients side? I need the server to show what port and IP the client is using.
    If you've tried to display the information on the client side unsuccesfully, share with us that part of your code so that we might could help you solve the problem.

Similar Threads

  1. Junit testing, testing list<e> interface
    By mackavelirip in forum New To Java
    Replies: 0
    Last Post: 10-05-2011, 06:08 AM
  2. Testing if it is an Int and if not ask again
    By Alexander_003 in forum New To Java
    Replies: 2
    Last Post: 11-27-2010, 12:09 AM
  3. Testing arguments
    By and0rsk in forum New To Java
    Replies: 6
    Last Post: 10-10-2010, 11:17 AM
  4. JDK availability in Testing server
    By curesh in forum Suggestions & Feedback
    Replies: 6
    Last Post: 01-26-2009, 03:33 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
  •