mirror of
https://github.com/kataras/iris.git
synced 2026-01-02 01:37:11 +00:00
Former-commit-id: 5f55201d9f494efd3f2f4d92231ad8f271ce94e6
This commit is contained in:
@@ -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())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user