Searching network for server
I've been pondering this for a while, and so i decided to join these forums to see if one of you could possibly point me in the right direction;
I'm wondering whether it's possible to search the network for a server on a specific port?
I.e. without a specified IP as the server class can be executed on a number of machines, however only one instance should be running and other clients would search the network to see if there is a service on port say 1234, if there is, it connects if not, it acts as the server and other clients can then connect to it.
I'm not sure whether I've explained myself fully and/or made a complete tool of myself.
Thanks,
:confused:
Re: Searching network for server
If you have a list of IP addresses for each possible machine, then loop through searching one at a time. If you don't have a list, how would you even go about starting a search?
Re: Searching network for server
That's why i was wondering :)
So i could simply use a loop to go through each ip?
so say the range started at 192.168.1.2
i could just increment the last digit? And if a server is found, it connects, if not it acts as the server.
Sweet!