server/server_handler.go
crusader f7435b7fa0 ing
2017-11-29 12:46:40 +09:00

29 lines
575 B
Go

package server
import (
"net"
)
type ServerHandler interface {
ServerContext() ServerContext
Init(serverCTX ServerContext) error
Listen(serverCTX ServerContext) (net.Listener, error)
OnStart(serverCTX ServerContext)
OnError(serverCTX ServerContext, conn net.Conn, status int, reason error)
// OnStop invoked when server is stopped
// If you override ths method, must call
//
// func (sh *ServerHandler) OnStop() {
// ...
// sh.ServerHandler.OnStop()
// }
OnStop(serverCTX ServerContext)
GetName() string
GetSocketHandler() SocketHandler
Validate()
}