Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using the net api

 
Chris Stewart
Ranch Hand
Posts: 184
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic