server/server_handler.go

24 lines
395 B
Go
Raw Normal View History

2017-10-26 11:14:00 +00:00
package server
import (
"io"
"net"
)
type ServerHandler interface {
2017-10-27 08:53:26 +00:00
OnStart()
OnStop()
2017-10-26 11:14:00 +00:00
Listen() (net.Listener, error)
2017-10-27 07:14:20 +00:00
OnHandshake(remoteAddr string, rwc io.ReadWriteCloser) error
2017-10-26 11:14:00 +00:00
Handle(remoteAddr string, rwc io.ReadWriteCloser, stopChan chan struct{})
2017-10-27 05:27:36 +00:00
IsClientDisconnect(err error) bool
2017-10-26 11:14:00 +00:00
GetAddr() string
Validate()
accept(l net.Listener) (io.ReadWriteCloser, string, error)
}