2017-11-29 12:24:48 +00:00
|
|
|
package client
|
|
|
|
|
2017-11-29 14:56:36 +00:00
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
"time"
|
|
|
|
)
|
2017-11-29 12:24:48 +00:00
|
|
|
|
|
|
|
type SocketHandler interface {
|
2017-11-30 03:15:05 +00:00
|
|
|
OnConnect(socketContext SocketContext, res *http.Response)
|
|
|
|
OnDisconnect(soc Socket)
|
2017-11-29 14:56:36 +00:00
|
|
|
|
2017-11-30 03:15:05 +00:00
|
|
|
GetMaxMessageSize() int64
|
|
|
|
GetWriteTimeout() time.Duration
|
|
|
|
GetReadTimeout() time.Duration
|
|
|
|
GetPongTimeout() time.Duration
|
|
|
|
GetPingTimeout() time.Duration
|
|
|
|
GetPingPeriod() time.Duration
|
2017-11-29 12:24:48 +00:00
|
|
|
|
|
|
|
// Validate is check handler value
|
|
|
|
// If you override ths method, must call
|
|
|
|
//
|
|
|
|
// func (sh *SocketHandlers) Validate() {
|
|
|
|
// sh.SocketHandlers.Validate()
|
|
|
|
// ...
|
|
|
|
// }
|
|
|
|
Validate()
|
|
|
|
}
|