MCPcopy
hub / github.com/gorilla/websocket / handleProtocolError

Method handleProtocolError

conn.go:979–986  ·  view source on GitHub ↗
(message string)

Source from the content-addressed store, hash-verified

977}
978
979func (c *Conn) handleProtocolError(message string) error {
980 data := FormatCloseMessage(CloseProtocolError, message)
981 if len(data) > maxControlFramePayloadSize {
982 data = data[:maxControlFramePayloadSize]
983 }
984 c.WriteControl(CloseMessage, data, time.Now().Add(writeWait))
985 return errors.New("websocket: " + message)
986}
987
988// NextReader returns the next data message received from the peer. The
989// returned messageType is either TextMessage or BinaryMessage.

Callers 1

advanceFrameMethod · 0.95

Calls 2

WriteControlMethod · 0.95
FormatCloseMessageFunction · 0.85

Tested by

no test coverage detected