MCPcopy Index your code
hub / github.com/coder/websocket / Close

Method Close

internal/wsjs/wsjs_js.go:136–140  ·  view source on GitHub ↗

Close closes the WebSocket with the given code and reason.

(code int, reason string)

Source from the content-addressed store, hash-verified

134
135// Close closes the WebSocket with the given code and reason.
136func (c WebSocket) Close(code int, reason string) (err error) {
137 defer handleJSError(&err, nil)
138 c.v.Call("close", code, reason)
139 return err
140}
141
142// SendText sends the given string as a text message
143// on the WebSocket.

Callers 3

TestGinFunction · 0.45
echoServerFunction · 0.45
EchoLoopFunction · 0.45

Calls 1

handleJSErrorFunction · 0.85

Tested by 2

TestGinFunction · 0.36
echoServerFunction · 0.36