2007-09-24 04:02:32 UTC
I'm hoping someone here might have an idea:
I have a server application that uses TServerSocket and its associates
to receive incoming TCP/IP connections from multiple client
applications. We actually have several instances of this server
application listening on different ports and/or on different machines,
and traffic is directed to each instance via a Network Load Balancing
What I would like to do is put a button on my application that will
cause the app to stop listening for new connections without
terminating the existing connections. This would enable support staff
to slowly take one instance out of the pool without having to
interrupt active users.
However, I haven't a clue how to do this. I could probably add code
in the OnGetSocket or OnConnecting events to refuse the connection,
but this would result in the client receiving an error and having to
try again, which I do not want. The NLB utility I am using will not
send connections to a port that is not listening, so that is what I
want to do. The TServerSocket object is NonBlocking, but changing
this to a multi-threaded app has been on my to do list for a while, so
if I must do so to gain this functionality, I will. I can also get
more information on the NLB utility, but right now I don't even really
know what to ask.
Can someone point me in the right direction?