See http://www.iana.org/assignments/websocket/websocket.xhtml#close-code-number and https://tools.ietf.org/html/rfc6455#section-7.4.1
(code StatusCode)
| 277 | // See http://www.iana.org/assignments/websocket/websocket.xhtml#close-code-number |
| 278 | // and https://tools.ietf.org/html/rfc6455#section-7.4.1 |
| 279 | func validWireCloseCode(code StatusCode) bool { |
| 280 | switch code { |
| 281 | case statusReserved, StatusNoStatusRcvd, StatusAbnormalClosure, StatusTLSHandshake: |
| 282 | return false |
| 283 | } |
| 284 | |
| 285 | if code >= StatusNormalClosure && code <= StatusBadGateway { |
| 286 | return true |
| 287 | } |
| 288 | if code >= 3000 && code <= 4999 { |
| 289 | return true |
| 290 | } |
| 291 | |
| 292 | return false |
| 293 | } |
| 294 | |
| 295 | func (ce CloseError) bytes() ([]byte, error) { |
| 296 | p, err := ce.bytesErr() |
no outgoing calls
searching dependent graphs…