[fpc-devel] TSocketServer.StartAccepting

Alexander Todorov alexx.todorov at gmail.com
Sun Jan 8 23:24:25 CET 2006


Hi to all the list,
I've just found SSockets unit. It is very easy to create a Server /
Client applications using the classes in the unit but one thing
bothers me.
in procedure TSocketServer.StartAccepting there are 2 repeat-until
loops and the outer one stops if NoConnections>=FMaxConnections.
NoConnections is a local variable and FMaxConnections is a class member.

How can one prevent TSocketServer stop accepting when MaxConnections
is reached ?

I have a client / server model and server handles the OnConnect event
to process data and send response to the client. After that the Data
parameter is freed which closes the connection with the client.

  TConnectEvent = Procedure (Sender : TObject; Data : TSocketStream) Of Object;

When MaxConnections is reached and new client tries to connect my app crashes.
Is there a way to prevent this crash or it might be my
misunderstanding of how this class works.



More information about the fpc-devel mailing list