Connecting to a remote host

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • manjuramesh
    New Member
    • Sep 2008
    • 1

    Connecting to a remote host

    Hi,
    I was working on a client server issue and did the following in the client code:

    DatagramSocket socket = new DatagramSocket( );
    socket.setSoTim eout(1000);
    .....
    DatagramPacket pkt = new DatagramPacket( message, message.length, address, port);
    socket.send(pkt );

    where address and port are command line args and are of the server.

    When the server is run on my machine i.e host address is 127.0.0.1, this works fine. but when i try to run the server on another machine and the client on mine. this just doest work. my packets do not reach the server. what am i missing here with respect to ip addresses? Please help.
  • myusernotyours
    New Member
    • Nov 2007
    • 188

    #2
    Hi,

    Sounds like an issue with your IP. You can try telneting in to the server and see if it works. Some machines may have more than one IP. If the program is working with localhost then there is no reason why it shouldn't work otherwise unless it's a connection issue.

    Regards,

    Alex.

    Comment

    Working...