Using a Twebsocketclient and connecting to a proprietary web socket server my websocket connection drops if I move off the browser tab hosting the web application. This includes when troubleshooting with the inspect feature of the browser. Is there some WebCore application setting to prevent this? I do not experience the socket dropping with a pure html client or a python client connecting to the same websocket server.
Owen,
First you can open the inspect feature of the browser in a new window so you can do both at the same time. Second, centralize you send routines and check for the active connection and reconnect to the backend. You can even run a timer and check and reconnect. It will still disconnect but the reconnect will be done automatically when the timer is restarted when the tab is in focus. Hope that helps.
Thanks for the suggestions John!
Owen, this is also a handy function so you can detect if the tab has focus. You can call the reconnect.
{$IFDEF WEBLIB}
asm
document.addEventListener("visibilitychange", () => {
if (document.hidden) {
this.FWindowActive = false;
} else {
this.FWindowActive = true;
}
});
end;
{$ENDIF}