package server import ( "io" "net" ) type ServerHandler interface { OnStart() OnStop() Listen() (net.Listener, error) OnHandshake(remoteAddr string, rwc io.ReadWriteCloser) error Handle(remoteAddr string, rwc io.ReadWriteCloser, stopChan chan struct{}) IsClientDisconnect(err error) bool GetAddr() string Validate() accept(l net.Listener) (io.ReadWriteCloser, string, error) }