Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Sockets and Internet Protocols
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Tim Cooke
paul wheaton
Jeanne Boyarsky
Ron McLeod
Sheriffs:
Paul Clapham
Liutauras Vilda
Devaka Cooray
Saloon Keepers:
Tim Holloway
Roland Mueller
Bartenders:
Forum:
Sockets and Internet Protocols
Broadcasting to addresses
Danny Carson
Greenhorn
Posts: 18
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
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.
InetAddress inet = InetAddress.getByName("127.0.0.1"); // dummy address DatagramSocket ds = new DatagramSocket(); String b = "the cat"; DatagramPacket dp = new DatagramPacket(b.getBytes(), b.length(), inet, 9100); ds.send(dp); String c = "die katze"; DatagramPacket response = new DatagramPacket(c.getBytes(), c.length()); System.out.println("Getting ready to receive packet..."); ds.receive(response); // display response String received = new String(response.getData()); System.out.println("received from port " + response.getPort() + " of " + response.getAddress().getHostName() + " is: "); ds.close(); // close socket } catch (Exception e) { System.out.println("Problem.. " + e); } System.out.println("End");
Cheers
T.A. Nguyen
Ranch Hand
Posts: 36
I like...
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
See the following example from sun:
http://java.sun.com/docs/books/tutorial/networking/datagrams/broadcasting.html
enjoy!
T.A. Nguyen
http://ta.cnci.org
http://www.linkedin.com/in/nguyenta
Danny Carson
Greenhorn
Posts: 18
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
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
I like...
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
You might want to visit:
http://sourceforge.net/projects/ipscan/
for detail.
T.A. Nguyen
http://ta.cnci.org
http://www.linkedin.com/in/nguyenta
Danny Carson
Greenhorn
Posts: 18
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
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
I like...
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
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!
T.A. Nguyen
http://ta.cnci.org
http://www.linkedin.com/in/nguyenta
Drove my Chevy to the levee but the levee was dry. A wrung this tiny ad and it was still dry.
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
DNS query, protocol
Problem in sending a packet
Finding All the IP Addresses to a LAN
Simple problem in running a Server class
Server and two clients
More...