Locking a server

In panda’s distributed code, how would I go about refusing new connections to a server? I want to wait for a number of clients to connect and then hit a button that disallows new connections to the server. I have tried to remove the listenerPoll task located in ServerRepository, but that only stops communication between the server and client. A new client can still connect (I am guessing the QueuedConnectionListener/Manager still creates the connection).

Another idea would be to allow the new connection but then immediately disconnect any new client after the “locked” flag has been set. However, it seems that the server repository can only handle a client side disconnect (through handleClientDisconnect).

Thanks for the help

You could call:


on the ServerRepository. That should close the TCP rendezvous and prevent new clients from connecting. Note there will be a slight race condition between the time you can decide to close the rendezvous and the time you actually do close it.


Many thanks. The race condition shouldn’t be a problem for right now.