MCPcopy
hub / github.com/coder/websocket / CloseNow

Method CloseNow

ws_js.go:244–246  ·  view source on GitHub ↗

CloseNow closes the WebSocket connection without attempting a close handshake. Use when you do not want the overhead of the close handshake. note: No different from Close(StatusGoingAway, "") in WASM as there is no way to close a WebSocket without the close handshake.

()

Source from the content-addressed store, hash-verified

242// note: No different from Close(StatusGoingAway, "") in WASM as there is no way to close
243// a WebSocket without the close handshake.
244func (c *Conn) CloseNow() error {
245 return c.Close(StatusGoingAway, "")
246}
247
248func (c *Conn) exportedClose(code StatusCode, reason string) error {
249 c.closingMu.Lock()

Callers 1

CloseReadMethod · 0.95

Calls 1

CloseMethod · 0.95

Tested by

no test coverage detected