Hello, I've been experimenting with WebSocketServer and Client functionalities in a Windows-VCL application. Overall, everything seems fine, but I'm encountering a delay when terminating the client app. It appears that if the client was connected to the WebSocketServer, it attempts to disconnect and waits for a response from the server.
I've attempted to disable this behavior using fmxWebSocketClient.Options:=fmxWebSocketClient.Options + [twsoManualClose];, and also during destruction:
if fmxwebsocketclient.active then begin
fmxwebsocketclient.Disconnect(false);
end;
However, these attempts haven't resolved the issue. My application still closes immediately when the client isn't actively used.
Just by connecting to the server and closing the application we cannot see this behavior.
Regarding to this, do you mean during the form's OnDestroy event? That's not really necessary, the Disconnect is called automatically when the component is destroyed.
Can you put together a small sample that reproduces your issue so we can take a look?
I know, that the component calls Disconnect on destructor. Because it hangs than in the background I have tried to call it manually with (false) als parameter to speed up the "destroying" process.
There is nothing special in my code. I create the client-component in runtime and connect + send one message to the server with .Send
If I only create the component without calling connect or .Send the app terminates immediately.