Open
Description
It is possible to open a connection and, before the FConnection is assigned, the status is set to wsConnected. Calling Send raises an AV because of that:
procedure TCrossWebSocket.Send(const AData: string;
const ACallback: TWsClientCallback);
begin
if (GetStatus = wsConnected) then
FConnection.WsSend(AData, ACallback); // FConnection is nil here
end;
This is an issue in a multi-threading environment. My suggestion would be to lock the access to the FConnection field or check if FConnection is assigned. Thanks!
Metadata
Metadata
Assignees
Labels
No labels