TsgcWebSocketClient › Methods › Connected
Queries the underlying socket to determine whether the client is currently connected to the server.
public bool Connected();
True if the underlying TCP client reports an active connection; False otherwise. (Boolean)
Connected delegates to the internal Indy TCP client's Connected method, which performs a low-level socket probe to detect the peer status. Because that probe can block the calling thread and increase CPU usage, Connected should be used sparingly. For most situations prefer the Active property, which is a cheap flag and safe to call from any thread. Connected may raise an exception if the TCP client has not been initialized yet.
if (oClient.Connected())
ShowMessage("The socket is still connected");