[java] Accessing networked computers

Started by
8 comments, last by CaptainJester 17 years, 9 months ago
I want to be able to retrieve all of the networked computers connected to the client's computer in order to check for other computers using the same software. I'm looking into Java.net classes, but i'm not sure where to start.
Bow before me... for i am l33t!
Advertisement
I'm not totaly sure what you mean, what is your goal? Finding all computers on the network sounds rather viral. Why do you need to find all computers running your program?

I'm not much of a network programer yet, (Still looking for a good place to start to actually learn an OpenGL binding for Java, not to just copy code from someone else with only half an idea of what it actually does) but sounds like having a small companion program with it would be good. A micro server you run somewhere, when you install/startup your program, have it find the IP of the computer it is on, then connect to the micro server to retreve a list of IPs currently running the program. Server takes the new connection and adds it to the list, have the server slowly cycle through its list to check for dropped connections, and updates clients with the new list.


That sort of thing might work, just an idea from someone with almost no network experience.

But still, just what do you want to do with this information, what sort of program are you trying to make? without that bit of info, there isn't a whole lot people can do to help you find the most effective solution.
Old Username: Talroth
If your signature on a web forum takes up more space than your average post, then you are doing things wrong.
Perhaps you could have the software sending periodic "pings" to the client system and the ping just hits a counter. I as well am not sure what your intent is. Are you checking for your own software (it could be modified)? Or are you creating your own software?
D. "Nex" ShankarRed Winter Studios
No viral intent here, you need not worry. I'm looking to see if other computers in the immediate network have the same program running. something like a network game lobby, so when the user logs on he or she sees if there are other games being hosted in the network.
Bow before me... for i am l33t!
ah, ok. If this is going to be setup for some sort of LAN, then I suggest you setup a centeral server program. It is installed first, and then everyone that installs it after the server is up and running sets it to connect to that computer running the server. This would be much easier to code up, and less likely to setoff security software than something that goes along, pinging every computer in a network.

Could also be easy to setup such software to run over a wider area.
Old Username: Talroth
If your signature on a web forum takes up more space than your average post, then you are doing things wrong.
Creating a server would fit my needs certainly, but if i were to give it to someone, they would have to configure their clients to connect to a certain computer the first time. So you don't think there is any way that I could do this without a central server without setting off some kind of alarms? and even if it did, how would i ping each computer?
Bow before me... for i am l33t!
I'm a more visual person. I used this setup in a local LAN tourney. Works great, except I didn't use 9 as the number of computers accessing a server (16)

We tried something new where we had a central hub which was our "control center." It connected to 3 "Nodes" which were the servers to which gamers connected. Therefore, we accessed 1 computer which controlled 3 computers which served 16 ea. Therefore, we had control over 48 computers that accessed the server - through one.

I just did the networking setup; the software part was out of my hands.

Here's the basic idea:
Image Hosted by ImageShack.us
D. "Nex" ShankarRed Winter Studios
As for pinging, its the software on each computer (in my view). It sends a small data file to the central server. Upon reception, the server just creates a "tally" / index of who has the software based on the ping.

Still kind of unclear; is this gaming software?
D. "Nex" ShankarRed Winter Studios
Well concider it a lobby. Its not specifically based on a game, its actually more of an experiment. I want to creat a collaboration program which allows many users to share files or write documents together over networks, even over the internet (but that is not hard, what is hard is the network side).

For my purposes, i just want to know if these programs can just connect to each other without the need of a central server, sort of a peer to peer program.

Also, let me be clear that I also intend for this to be used for a game as well. I want to have each client find a hosted game on the network without having to use the ip.
Bow before me... for i am l33t!
MultiCast sockets might help you. You just have to be careful with them, they can cause a lot of bandwidth usage.

Multicast tutorial
"None of us learn in a vacuum; we all stand on the shoulders of giants such as Wirth and Knuth and thousands of others. Lend your shoulders to building the future!" - Michael Abrash[JavaGaming.org][The Java Tutorial][Slick][LWJGL][LWJGL Tutorials for NeHe][LWJGL Wiki][jMonkey Engine]

This topic is closed to new replies.

Advertisement