ing
This commit is contained in:
parent
177a3c9a4c
commit
0669531b0f
@ -90,7 +90,7 @@ func (soc *socket) run() {
|
||||
|
||||
func (soc *socket) onDisconnected() {
|
||||
soc.disconnectCh <- true
|
||||
soc.sh.(*SocketHandlers).onDisconnected(soc)
|
||||
soc.sh.getOnDisconnected()(soc)
|
||||
}
|
||||
|
||||
func (soc *socket) onMessage(messageType int, r io.Reader) {
|
||||
|
@ -2,6 +2,10 @@ package overflow_gateway_websocket
|
||||
|
||||
import "time"
|
||||
|
||||
type (
|
||||
onDisconnectedFunc func(soc Socket)
|
||||
)
|
||||
|
||||
// SocketHandler is configuration of the websocket server
|
||||
type SocketHandler interface {
|
||||
GetMaxMessageSize() int64
|
||||
@ -12,6 +16,7 @@ type SocketHandler interface {
|
||||
GetPingPeriod() time.Duration
|
||||
IsBinaryMessage() bool
|
||||
GetProtocol() ProtocolHandler
|
||||
setOnDisconnected(cb func(soc Socket))
|
||||
setOnDisconnected(cb onDisconnectedFunc)
|
||||
getOnDisconnected() onDisconnectedFunc
|
||||
Validate()
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user