File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes host computers in network(LAN) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "host computers in network(LAN)" Watch "host computers in network(LAN)" New topic
Author

host computers in network(LAN)

S. Ganapathy
Ranch Hand

Joined: Mar 26, 2003
Posts: 194
Hi there,
I am facing one problem while findingout all host machines in the LAN. I want to display all available hosts in the list. Can anybody help me to find all machines (host names/ip addresses) in the local area network
Ganapathy
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

Simple answer. Why? This isn't a requirement for the assignment, so why do it at all. The only thing you get is the possibly losing points, you will not gain any points for incorporating this.
If you just want to know the answer for this as a personal reason, I'd suggest posting the question in the distrubuted forum.
Mark
[ May 19, 2003: Message edited by: Mark Spritzler ]

Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
S. Ganapathy
Ranch Hand

Joined: Mar 26, 2003
Posts: 194
Hi Mark,
I want to provide the list of available computers in the network, is basically to choose the location of the database. If server runs on a differnet machine, how to select that. For this I thought to provide this solution, but other way is to provide text filed, where user enters machine name or ip address (where the server is up and running). Eg: //ganapathy. If the server is not available, interface will display appropriate message. Please let me know your idea on this.
Regards,
Ganapathy
Damian Ryan
Ranch Hand

Joined: May 09, 2003
Posts: 117
I agree with Mark.
Not only does your solution add unrequired complexity to your system, it does not address the case where a database server resides on a different subnet to your client.
Would you try to have your "host browser" capable of browsing the whole Internet?
I would stick with an editable text field, and perhaps use input validation (see the Sun tutorial on text fields) to ensure that only characters that are valid for a host name (ASCII letters, digits, hyphens and underscores, I think) are enterable.


Always proofread carefully to see if you any words out.
S. Ganapathy
Ranch Hand

Joined: Mar 26, 2003
Posts: 194
Hi Damian Ryan,
We can provide either solutions. It is the problem of permission if we have to access subnet.
In my case, we no need to bother about machine name. But I am surely looking for alternative because, I need to use InetAddress class in java.net package.
But I feel there should be flexible to user, if user enter ip address instead of machine name, still the system should be able to resolve.
Any way, providing text field is a better alternative, and it is easier as well. I too agree with you.
Regards,
Ganapathy
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

S. What is your first name?
You solution for listing available servers is too far beyond the requirements that I strongly recommend not using this solution.
The user should be able to enter an IP address or server Name.
If you concerns are regarding to DNS servers, and other Networking issues, you can ignore these problems and safely assume that they have these network issues configured correctly, such that if they enter the server name or IP address that that server is available and they can access it without outside networking issues.
Mark
S. Ganapathy
Ranch Hand

Joined: Mar 26, 2003
Posts: 194
Hi Mark,
My first name is Ganapathy, and "S" is the sir name initial.
So is it better to use machine name or ipaddress to choose server? I am also convinenced by this. What ever I proposed, begining itself, I had doubt about the complication, as I am dragging the solution beyong the requirement.
I planned to provide a text field to enter server name/ip address for the database location.
Regards,
Ganapathy
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

Cool.
Mark
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: host computers in network(LAN)
 
Similar Threads
hosts in LAN
Is there any method to get address of all machines in network
Fetching all ip addresses in LAN
problem in simple chat application.
How do I browse other machines on the network in Linux Mandrake 8.2?