2017-11-30 10:16:55 +00:00
|
|
|
package client
|
|
|
|
|
|
|
|
import (
|
|
|
|
"log"
|
|
|
|
"net"
|
|
|
|
|
|
|
|
csc "git.loafle.net/commons_go/server/client"
|
|
|
|
)
|
|
|
|
|
|
|
|
type SocketHandlers struct {
|
|
|
|
csc.SocketHandlers
|
|
|
|
}
|
|
|
|
|
|
|
|
func (sh *SocketHandlers) OnConnect(socketContext csc.SocketContext, conn net.Conn) {
|
|
|
|
log.Printf("OnConnect res: %v \n", conn)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (sh *SocketHandlers) OnDisconnect(soc csc.Socket) {
|
|
|
|
log.Printf("OnDisconnect \n")
|
|
|
|
}
|
|
|
|
|
|
|
|
func (sh *SocketHandlers) Validate() {
|
|
|
|
sh.SocketHandlers.Validate()
|
|
|
|
}
|
|
|
|
|
2017-11-30 10:22:18 +00:00
|
|
|
func NewSocketHandler() csc.SocketHandler {
|
2017-11-30 10:16:55 +00:00
|
|
|
return &SocketHandlers{}
|
|
|
|
}
|