TMSFNCWebsocketClient - How to detect if server is down and automatically reconnect?

Hi, I am looking for some code example how to detect using TMSFNCWebsocketClient if server goes down during active connection and automatically reconnect when server was available again.

When server goes down TTMSFNCWebsocketClient.Active property stays True. So I temporary made this method in your VCL.TMSFNCWebSocketClient unit to detect If connection is active or not.

function TTMSFNCCustomWebsocketClient.IsConnected: Boolean;
Result := Connection.GetConnection.IOHandler.Connected

Procedure "TTMSFNCWebSocketConnection.SendFrame(aFrame: TTMSFNCWebSocketFrame)" internally check If connection is active but
if connection is not active this function simply ignore sending frame and application that uses this component doesn't know that sending was faild. Rasing some error and seting "Active" property to false would be desirable.



This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.