mirror of
https://github.com/kataras/iris.git
synced 2025-01-23 18:51:03 +01:00
Former-commit-id: 5f55201d9f494efd3f2f4d92231ad8f271ce94e6
This commit is contained in:
parent
b08df3a785
commit
21ab51bde7
|
@ -2,6 +2,7 @@ package websocket
|
|||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"io"
|
||||
"net"
|
||||
"strconv"
|
||||
|
@ -580,7 +581,14 @@ func (c *connection) Wait() {
|
|||
c.startReader()
|
||||
}
|
||||
|
||||
// ErrAlreadyDisconnected can be reported on the `Connection#Disconnect` function whenever the caller tries to close the
|
||||
// connection when it is already closed by the client or the caller previously.
|
||||
var ErrAlreadyDisconnected = errors.New("already disconnected")
|
||||
|
||||
func (c *connection) Disconnect() error {
|
||||
if c == nil || c.disconnected {
|
||||
return ErrAlreadyDisconnected
|
||||
}
|
||||
return c.server.Disconnect(c.ID())
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user