Ye, every time , but it is matter of a couple of few ms difference between client connections - if the time connection difference is few hundred ms there is no problem.
Today I compiled stress examples from LNet and when I run it from WinCe device after 50-60 to 200 connect/disconnect it crashes my app.
What was crashed (Server or client) ?
What was the type of connection (wireless, bluetooth,GPRS ...) ?
Do you use OnCanSend event ?
Do you checked Count property (do you close connections or they are still alive ) ?
Application crashed on my client Datalogic unit, it was connected on WiFi. Today I compiled again stress example for wince and it's working now. I only removed on server side this line of code:
procedure TForm1.LTCPCompAccept(aSocket: TLSocket);
begin
UpdateLog('Konekcija prihvacena od: tran. Connection accepted from ' + aSocket.PeerAddress + ':' + IntToStr(aSocket.PeerPort));
//lbClients.Items.AddObject(aSocket.PeerAddress, TObject(aSocket));
end;
No, in this example I don't use OnCanSend.
Do you checked Count property (do you close connections or they are still alive ) ?
Can you explain this to me, I mean, do I have to close connections on both side?
I noticed when I run this test stress example, on client side memory allocation is the same. On server side it rises slowly.
On server side I don't have any method of closing connection, on client side is this:
if Assigned(aSocket) then
aSocket.Creator.Free;
About this problem of two clients connecting at the same time, for example: can you define a variable that states that connection is established by one socket, so the next waits a few ms in while loop until the first one finishes?
Or to make them in a thread, but I read that the author abondoned this approach, now it's using single thread?
EDIT: I ve just started to keep log of Count property, it just keeps rising, until I shutdown server, then it starts from 0. How do I decrease count on server side?