20 lines
291 B
Go
20 lines
291 B
Go
package server
|
|
|
|
import (
|
|
"net"
|
|
)
|
|
|
|
type ServerHandler interface {
|
|
Listen() (net.Listener, error)
|
|
OnAccept(conn net.Conn) (net.Conn, error)
|
|
|
|
OnStart()
|
|
OnStop()
|
|
|
|
Handle(conn net.Conn, stopChan <-chan struct{}, doneChan chan<- struct{})
|
|
|
|
IsClientDisconnect(err error) bool
|
|
|
|
Validate()
|
|
}
|