CloseWithMsg closes the session with the provided payload. Use the FormatCloseMessage function to format a proper close message payload.
(msg []byte)
| 192 | // CloseWithMsg closes the session with the provided payload. |
| 193 | // Use the FormatCloseMessage function to format a proper close message payload. |
| 194 | func (s *Session) CloseWithMsg(msg []byte) error { |
| 195 | if s.closed() { |
| 196 | return ErrSessionClosed |
| 197 | } |
| 198 | |
| 199 | s.writeMessage(envelope{t: websocket.CloseMessage, msg: msg}) |
| 200 | |
| 201 | return nil |
| 202 | } |
| 203 | |
| 204 | // Set is used to store a new key/value pair exclusively for this session. |
| 205 | // It also lazy initializes s.Keys if it was not used previously. |
nothing calls this directly
no test coverage detected