forked from mirror/websocket
parent
7274f97ac5
commit
67d178946a
12
conn.go
12
conn.go
|
@ -65,9 +65,19 @@ var (
|
||||||
ErrReadLimit = errors.New("websocket: read limit exceeded")
|
ErrReadLimit = errors.New("websocket: read limit exceeded")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type websocketError struct {
|
||||||
|
msg string
|
||||||
|
temporary bool
|
||||||
|
timeout bool
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *websocketError) Error() string { return e.msg }
|
||||||
|
func (e *websocketError) Temporary() bool { return e.temporary }
|
||||||
|
func (e *websocketError) Timeout() bool { return e.timeout }
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
errWriteTimeout = &websocketError{msg: "websocket: write timeout", timeout: true}
|
||||||
errBadWriteOpCode = errors.New("websocket: bad write message type")
|
errBadWriteOpCode = errors.New("websocket: bad write message type")
|
||||||
errWriteTimeout = errors.New("websocket: write timeout")
|
|
||||||
errWriteClosed = errors.New("websocket: write closed")
|
errWriteClosed = errors.New("websocket: write closed")
|
||||||
errInvalidControlFrame = errors.New("websocket: invalid control frame")
|
errInvalidControlFrame = errors.New("websocket: invalid control frame")
|
||||||
)
|
)
|
||||||
|
|
|
@ -15,6 +15,8 @@ import (
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var timeoutErrImplementsNetError net.Error = errWriteTimeout
|
||||||
|
|
||||||
type fakeNetConn struct {
|
type fakeNetConn struct {
|
||||||
io.Reader
|
io.Reader
|
||||||
io.Writer
|
io.Writer
|
||||||
|
|
Loading…
Reference in New Issue