MCPcopy Index your code
hub / github.com/screego/server / CloseOnError

Method CloseOnError

ws/client.go:72–85  ·  view source on GitHub ↗

CloseOnError closes the connection.

(code int, reason string)

Source from the content-addressed store, hash-verified

70
71// CloseOnError closes the connection.
72func (c *Client) CloseOnError(code int, reason string) {
73 c.once.Do(func() {
74 go func() {
75 c.read <- ClientMessage{
76 Info: c.info,
77 Incoming: &Disconnected{
78 Code: code,
79 Reason: reason,
80 },
81 }
82 }()
83 c.writeCloseMessage(code, reason)
84 })
85}
86
87func (c *Client) CloseOnDone(code int, reason string) {
88 c.once.Do(func() {

Callers 2

startReadingMethod · 0.95
startWriteHandlerMethod · 0.95

Calls 2

writeCloseMessageMethod · 0.95
DoMethod · 0.80

Tested by

no test coverage detected