24 lines
395 B
Go
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)
|
|
}
|