Datagrams from Java

Hello there, wonder if anyone can help me.
I am trying to send and receive datagrams using Java. I have copied two programs from a book, one to receive datagrams and one to send.

The receive datagram program has a parameter of a port to receive the data on.

The send program has three parameters, host , port and message.

I have a dial up account.

Now, the programs have all compiled correctly but if I try and use the send program using my node name I get the message "Network is unreachable", if I use it with a node that I know exists "post.demon.co.uk" the datagram is sent (I presume it is as the modem lights flash!!), so this must mean the the DNS is working...

If I try it with my IP address, I get the same message.

If I try it with 127.0.0.1 (loopback) the send light flashes once, but I do not receive the message.

Basically my question is, what ports should I be specifying with modem dial up and what is going on with the DNS ?

Can anybody help me ?
covellcAsked:
Who is Participating?
 
unicorntechConnect With a Mentor Commented:
As you have a dial up account I would doubt that your node has been allocated a fully qualified domain name (FQDN). This would be why you could send tot a site that you know exists but not to your own. Also 127.0.0.1 is a loopback interface and hence the modem lights won't flash as the datagram will remain on the local PC.

let me know what you are trying to achieve and I will see if I can help.

Also I think what you are trying to do is not possible with your current setup.
0
 
covellcAuthor Commented:
What I am trying to do is  use Java to send datagrams to a friends PC. We then hope to build a "chat" type interface. I have  copied this program to send and receive data grams, so I just wanted to test it.

It is funny, cos I can't ping 127.0.0.1 either...

Is there a reason why I should not be able to ping my own IP address (not the 127...) ? I get a network unreachable when I try !!!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.