server/server_handler.go
crusader 1cdf24971c ing
2017-11-29 09:57:03 +09:00

28 lines
541 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
Validate()
}