Meaningless Drivel is fun!*
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
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
 
Similar Threads
Setting the Type of Service (ToS) field in the IP header of a packet
Malformed or illegal request in HttpConnection !!
Testing web application?
Host IP
accessing a jsp file in tomcat