18 lines
331 B
Go
18 lines
331 B
Go
package client
|
|
|
|
import "net"
|
|
|
|
type SocketHandler interface {
|
|
OnConnect(socketContext SocketContext, conn net.Conn)
|
|
OnDisconnect(soc Socket)
|
|
|
|
// Validate is check handler value
|
|
// If you override ths method, must call
|
|
//
|
|
// func (sh *SocketHandlers) Validate() {
|
|
// sh.SocketHandlers.Validate()
|
|
// ...
|
|
// }
|
|
Validate()
|
|
}
|