File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Java » Java in General
Bookmark "Using the net api" Watch "Using the net api" New topic

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.
I agree. Here's the link:
subject: Using the net api
It's not a secret anymore!