server/server_handler.go
crusader a1cf7963b5 ing
2018-03-27 15:43:21 +09:00

31 lines
615 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(serverCTX ServerContext)
// Destroy invoked when server will destroy
// If you override ths method, must call
//
// func (sh *ServerHandler) Destroy() {
// ...
// sh.ServerHandler.Destroy()
// }
Destroy(serverCTX ServerContext)
GetName() string
GetSocketHandler() SocketHandler
Validate()
}