Newsgroups : Borland : borland.public.delphi.internet.winsock : 2008 Mar : 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 23:50:11 |
On Tue, 25 Mar 2008 14:59:07 -0700, "Remy Lebeau \(TeamB\)"
<no.spam@no.spam.com> wrote:
>
>"Bo Berglund" <bo.berglund@telia.com> wrote in message
>news:19piu3hng3vckj502n95o213j0kqe427d4@4ax.com...
>
>> How can I determine if a client connection already exists?
>
> procedure TForm1.Server1ClientConnect(Sender: TObject; Socket:
>TCustomWinSocket);
> begin
> if ServerSocket1.Socket.ActiveConnections > 1 then Socket.Close;
> end;
>
Thanks,
I had already thought of creating a TList object to keep all connected
clients and then on disconnect delete the corresponding entry. But it
seems to be a bit of a problem to guarantee that the delete is always
performed...
Better to use the method you indicated. :-)
/BoB