Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / December 2005

Tip: Looking for answers? Try searching our database.

An intranet question

Thread view: 
Allen Charlton - 26 Dec 2005 10:21 GMT
Anybody know how to obtain the information of all the hosts that are in
the same local network as mine? For example, on Windows, how can I get
a list of computers' information in the same workgroup?

Computers in the same intranet has the same IP address prefix (such as
192.168.0.1 through 192.168.0.255). Especially I want to get the list
of those hosts' IP addresses.

Is any class in package java.net able to do this job? Hope I clearly
express my problem. Thanks!
Juhan Kundla - 26 Dec 2005 12:45 GMT
Hei!

> Anybody know how to obtain the information of all the hosts that are in
> the same local network as mine? For example, on Windows, how can I get
> a list of computers' information in the same workgroup?

For this, the Windows uses the SMB protocol. The SMB can be used over
several network protocols, like TCP/IP, NetBIOS. In SMB network, every
host braoadcasts its SMB address to other hosts, that's how you can
browse the network and see the list of hosts.

http://en.wikipedia.org/wiki/Server_Message_Block

> Computers in the same intranet has the same IP address prefix (such as
> 192.168.0.1 through 192.168.0.255). Especially I want to get the list
> of those hosts' IP addresses.

One way to create the list of IP addresses of the hosts of an IP subnet
is to ping the broadcast address of the subnet. If the network is
configured correctly and the ICMP requests are not DENIED or REJECTED by
the firewall rules of the hosts, then all hosts in the network should
reply to your ping. Using those replies, you should be able to create
such list.

> Is any class in package java.net able to do this job? Hope I clearly
> express my problem. Thanks!

You need to find some sort of an interface to ICMP protocol in Java. I
don't know if the java.net has some implementation for this or not.

http://en.wikipedia.org/wiki/ICMP

Juhan
castillo.bryan@gmail.com - 27 Dec 2005 03:30 GMT
> Anybody know how to obtain the information of all the hosts that are in
> the same local network as mine? For example, on Windows, how can I get
[quoted text clipped - 6 lines]
> Is any class in package java.net able to do this job? Hope I clearly
> express my problem. Thanks!

There is a 3rd party library that can probably do it, called JCIFS.  I
have used it to access files on a windows share, but I haven't tried
listing a domain, or workgroup.  The API says it can do it though.

http://jcifs.samba.org/src/docs/api/jcifs/smb/SmbFile.html


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.