Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2006-01

TSocketServer.StartAccepting

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Alexander Todorov

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.

Reply by email