server/server_handler.go
crusader ab60b6ccda ing
2017-10-27 17:53:26 +09:00

24 lines
395 B
Go

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)
}