Newsgroups : Borland : borland.public.delphi.internet.winsock : 2008 Mar : Re: How to limit number of concurrent clients in TServerSocket?

www.cryer.info
Managed Newsgroup Archive

Re: How to limit number of concurrent clients in TServerSocket?

Subject:Re: How to limit number of concurrent clients in TServerSocket?
Posted by:"Bo Berglund" (bo.berglu..@telia.com)
Date:Tue, 25 Mar 2008 21:55:15

On Mon, 24 Mar 2008 10:12:55 -0700, "Remy Lebeau \(TeamB\)"
<no.spam@no.spam.com> wrote:

>
>"Bo Berglund" <bo.berglund@telia.com> wrote in message
>news:o4dcu3dmejk5n3du85v3t14h8hq00lic15@4ax.com...
>
>> But there seems to be no property on TServerSocket that can be used to
>> limit the number of connections, so what is the best way to do it?
>
>TServerSocket is not really designed for that.  The best you can do is
>Close() the new connection in the OnClientConnect event hander if a previous
>connection already exists.
>

How can I determine if a client connection already exists?
Is thare some way to enumarate active connections, or do I have to
keep track of this myself?

I am reluctant to put in some code that makes it possible for me to
screw up when I update the remote server system. Because if it fails
it means a service call on location by someone to restart the system
again. Very costly. It is a *remote* system...

But at the same time I don't want to have multiple connections when I
introduce the new functionality because only one connection can be
open towards the physical instrumentation at the server side. So by
disallowing multiple TCP clients I can ensure that requirement at
least...

The system includes functionality to make a self update by
transferring the new exe file and then cycle the service off-on with
exe copy in between. So the update can be done via the net. :-)
But once it is down (because of some stupid bug I may include) there
is no way back, someone has to go there in person....


/BoB

Replies:

In response to:

www.cryer.info
Managed Newsgroup Archive