21 lines
385 B
Go
21 lines
385 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)
|
|
|
|
IsClientDisconnect(err error) bool
|
|
|
|
Validate()
|
|
}
|