Limiting number of clients

BlitzMax Forums/BlitzMax Programming/Limiting number of clients

jsp(Posted 2012) [#1]
I'm looking for a way to limit the number of clients active at the same time in a certain network.

The problem is that although they all talk to a server, I don't have access to it, to store information.

How could a client know of other clients in a network (LAN only), without knowing each other IP?


Derron(Posted 2012) [#2]
I don't know if i understood it right (sometimes more words seems to be better :D).

Assumption: You have a network, the server is not modifiable for you, all clients in the network can talk to that server but don't know each other.

Solution: Each client broadcasts its existence to the network. This is only possible using: IPv4 and a "local" lan (or vpn). Clients then react on that broadcast with adding the sender to a list (with creation date and lifetime stored too).

Without broadcasting the clients are not able to recognize other clients except the packets of the server contain the original server (server = relay). In the case of a relay - just add the original sender of a packet to a list ...

PS: most times the server has the information about its clients stored somewhere ... maybe you can request it somehow - bt this depends on the software implementation about which you didn't mention something.

bye
Ron


jsp(Posted 2012) [#3]
Thanks and sorry I'm often quite very short with my descriptions, no idea why.
But your assumption is totally correct!

I thought also about a broadcast, but don't know yet to tell BMax to listen to it. It would also add some overhead to the program as it would need to parse all the time broadcast messages, instead of doing it's job (maybe a god job for a separate thread).

The software implementation is just a proprietary format, nothing open, where I can steer some behavior from remote via XMLHttpRequest (which works fine so far). The only response I get is a status message, if my request was successful.


Derron(Posted 2012) [#4]
if you know the port of broadcasts - listen at that port.
Think of it as a "information channel".

I usually broadcast using udp (easier connection management, no need for target port setups). Communication within that information channel could be done in a separate thread/layer.

http://www.blitzbasic.com/Community/posts.php?topic=75694#846152
could help too.

I'm not sure but I think I posted some code weeks ago about that thingy too.

bye
Ron


jsp(Posted 2012) [#5]
Thanks, will check that out.