MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / Disconnect

Method Disconnect

sdks/csharp/src/SpacetimeDBClient.cs:565–586  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

563 }
564
565 public void Disconnect()
566 {
567 isClosing = true;
568 connectionClosed = true;
569 FailPendingOperations(new OperationCanceledException("Connection closed."));
570
571 // Only try to close if the connection is active
572 if (webSocket.IsConnected)
573 {
574 webSocket.Close();
575 }
576#if UNITY_WEBGL && !UNITY_EDITOR
577 else if (webSocket.IsConnecting)
578#else
579 else if (webSocket.IsConnecting || webSocket.IsNoneState)
580#endif
581 {
582 webSocket.Abort(); // forceful during connecting
583 }
584
585 _parseCancellationTokenSource.Cancel();
586 }
587
588 /// <summary>
589 /// Connect to a remote spacetime instance.

Callers

nothing calls this directly

Calls 2

CloseMethod · 0.80
AbortMethod · 0.45

Tested by

no test coverage detected