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

Method CancelConnect

sdks/csharp/src/WebSocket.cs:393–402  ·  view source on GitHub ↗

Cancel an in-flight ConnectAsync. Safe to call if no connect is pending.

()

Source from the content-addressed store, hash-verified

391 /// Cancel an in-flight ConnectAsync. Safe to call if no connect is pending.
392 /// </summary>
393 public void CancelConnect()
394 {
395#if UNITY_WEBGL && !UNITY_EDITOR
396 // No CTS on WebGL. Mark cancel intent so that when socket id arrives or open fires,
397 // we immediately close and avoid reporting a connected state.
398 _cancelConnectRequested = true;
399#else
400 try { _connectCts?.Cancel(); } catch { /* ignore */ }
401#endif
402 }
403
404 public Task Close(WebSocketCloseStatus code = WebSocketCloseStatus.NormalClosure)
405 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected