wood burning stoves 2.0*
The moose likes Java in General and the fly likes Using the net api Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Using the net api" Watch "Using the net api" New topic
Author

Using the net api

Chris Stewart
Ranch Hand

Joined: Sep 14, 2002
Posts: 184
I'm trying to learn some of the net api in java. Does anyone know how I can find things such as hostname, external IP, and internal IP? I'd like to be able to find all internal IPs of the network I am on and send a ping to each. Thanks in advance.
Chris De Vries
Ranch Hand

Joined: Dec 05, 2002
Posts: 65
As far as java network programming goes, I would recommend the O'Reilly book "Java Network Programming" by Elliotte Rusty Harold. One limitation of java's internal network classes is that they are confined to TCP and UDP protocols. Ping requires ICMP (Internet Control Message Protocol). There is a raw sockets library avialable for java here. It was written using JNI and can probably do all the things you are looking for, but I have never tried using it.
I hope this helps a little.
Chris
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Using the net api