2017-10-27 07:07:14 +00:00
|
|
|
package server
|
|
|
|
|
2017-10-27 07:48:49 +00:00
|
|
|
import (
|
|
|
|
"io"
|
|
|
|
"time"
|
|
|
|
)
|
2017-10-27 07:07:14 +00:00
|
|
|
|
|
|
|
type ClientHandler interface {
|
2017-10-27 08:53:26 +00:00
|
|
|
OnStart()
|
|
|
|
OnStop()
|
|
|
|
|
2017-10-27 07:07:14 +00:00
|
|
|
Dial() (conn io.ReadWriteCloser, err error)
|
|
|
|
OnHandshake(remoteAddr string, rwc io.ReadWriteCloser) error
|
|
|
|
Handle(rwc io.ReadWriteCloser, stopChan chan struct{})
|
|
|
|
|
|
|
|
GetAddr() string
|
2017-10-27 07:48:49 +00:00
|
|
|
GetPendingRequests() int
|
|
|
|
GetRequestTimeout() time.Duration
|
|
|
|
GetSendBufferSize() int
|
|
|
|
GetRecvBufferSize() int
|
|
|
|
GetKeepAlivePeriod() time.Duration
|
|
|
|
|
2017-10-27 07:07:14 +00:00
|
|
|
Validate()
|
|
|
|
}
|