You are not logged in.
Pages: 1
I try your code but no luck in my case.
Unfortunately I have no time now for further investigation so I must stay on the January release.
In SynCrtSock unit, function TCrtSocket.SockReceivePending return cspNoData in case of broken connection.
Previous release return cspDataAvailable that is correctly handled and generate the notification of OnWebSocketsClosed.
Something is not ok after the Select function call
res := Select(fSock+1,@fdset,nil,nil,@tv);
if res<0 then
result := cspSocketError else
if (res>0) and(fdset.fd_count=1) and (fdset.fd_array[0]=fSock) and
(IoctlSocket(fSock,FIONREAD,pending)=0) and (pending>0) then
result := cspDataAvailable else
result := cspNoData;
Thanks for your quick reply.
I followed your suggestion but the result is the same, so I don't think it depends on the order of the two operations, also because otherwise it wouldn't work even with the previous version.
The behavior is different in the function TWebSocketProcessClientThread.Execute (in SynBidirSock.pas unit)
Old Release: fProcess.ProcessLoop Exit with sockerror <> 0 and trigger the OnWebSocketsClosed event
Current Release : fProcess.ProcessLoop continue iteration (sockerror = 0)
I will try to investigate by myself, but any help is welcome.
I recompile my code after an upgrade of the repository and with the actual release the OnWebSocketsClosed event is not fired.
Client := TSQLHttpClientWebsockets.Create(strHostName, strPortNumber, TSQLModel.Create([TSQLWatchDog]));
Client.Model.Owner := Client;
Client.WebSocketsUpgrade (TRANSMISSION_KEY);
Client.OnWebSocketsClosed := OnWebSocketsClosed;
If I recompile with old release (from January 2019) the event is fired as expected.
Am I miss something?
(Compiler : Delphi 10.3 Community Edition)
Pages: 1