TsgcWebSocketClient | Client Close Connection

Connection can be closed using Active property, Stop or Disconnect methods, read more from Client Open Connection.

 

CleanDisconnect

When connection is closed, you can notify other peer that connection is closed sending a message about close connection, to enable this feature, Set Options.CleanDisconnect property to true.

If this property is enabled, before connection is closed, a Close message will be sent to server to notify that client is closing connection.

 

Disconnect

TsgcWSConnection has a method called Disconnect(), that allows to disconnect connection at socket level. If you call this method, socket will be disconnected directly without waiting any response from server. You can send a Close Code with this method.

 

Close

TsgcWSConnection has a method called Close(), which allows to send a message to server requesting to close connection, if server receives this message, must close the connection and client will receive a notification that connection is closed. You can send a Close Code with this method.