35 lines
599 B
Go
35 lines
599 B
Go
package server
|
|
|
|
import (
|
|
"errors"
|
|
"log"
|
|
"net"
|
|
)
|
|
|
|
type ServerHandlers struct {
|
|
}
|
|
|
|
func (sh *ServerHandlers) OnStart() {
|
|
// no op
|
|
}
|
|
|
|
func (sh *ServerHandlers) OnStop() {
|
|
// no op
|
|
}
|
|
|
|
func (sh *ServerHandlers) Listen() (net.Listener, error) {
|
|
return nil, errors.New("Server: Handler method[Listen] of Server is not implement")
|
|
}
|
|
|
|
func (sh *ServerHandlers) OnAccept(conn net.Conn) (net.Conn, error) {
|
|
return conn, nil
|
|
}
|
|
|
|
func (sh *ServerHandlers) Handle(conn net.Conn, stopChan <-chan struct{}, doneChan chan<- struct{}) {
|
|
log.Printf("Server.Handle")
|
|
}
|
|
|
|
func (sh *ServerHandlers) Validate() {
|
|
|
|
}
|