Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Broadcasting to addresses

 
Danny Carson
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey guys n gals,

I am trying to check all addresses on a LAN to determine if they use port 9100.

I have looked at DatagramSocket/Packet but I could be missing something.

Can you tell me if this is possible to do in Java?

Code below is to test the Datagram on one address but this doesnt work either.



Cheers
 
T.A. Nguyen
Ranch Hand
Posts: 36
Eclipse IDE Java ME Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See the following example from sun:

http://java.sun.com/docs/books/tutorial/networking/datagrams/broadcasting.html

enjoy!
 
Danny Carson
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Im looking for an example of how to scan a network to find all ip's with a specific open port.

Any ideas?

cheers
 
T.A. Nguyen
Ranch Hand
Posts: 36
Eclipse IDE Java ME Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You might want to visit:

http://sourceforge.net/projects/ipscan/

for detail.
 
Danny Carson
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey man,

Thats a cool app, I was looking to itegrate a java version similar to this into my current project.

I can scan a network much like this although I am using sockets to ping the addresses, which takes an age. Is there any way to speed it up?

Cheers
 
T.A. Nguyen
Ranch Hand
Posts: 36
Eclipse IDE Java ME Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, read on more about the Multicast DNS. Make sure to read it carefully, you can potentially doing harm to your network. http://www.multicastdns.org/

Enjoy!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic