29 lines
504 B
Go
29 lines
504 B
Go
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()
|
|
}
|
|
|
|
func NewSocketHandler() SocketHandler {
|
|
return &SocketHandlers{}
|
|
}
|