This commit is contained in:
crusader 2017-11-07 17:38:50 +09:00
parent 3a437b10a4
commit 5edc46cefe
3 changed files with 7 additions and 7 deletions

View File

@ -13,7 +13,5 @@ type ServerHandler interface {
Handle(conn net.Conn, stopChan <-chan struct{}, doneChan chan<- struct{}) Handle(conn net.Conn, stopChan <-chan struct{}, doneChan chan<- struct{})
IsClientDisconnect(err error) bool
Validate() Validate()
} }

View File

@ -2,7 +2,6 @@ package server
import ( import (
"errors" "errors"
"io"
"log" "log"
"net" "net"
) )
@ -30,10 +29,6 @@ func (sh *ServerHandlers) Handle(conn net.Conn, stopChan <-chan struct{}, doneCh
log.Printf("Server.Handle") log.Printf("Server.Handle")
} }
func (sh *ServerHandlers) IsClientDisconnect(err error) bool {
return err == io.ErrUnexpectedEOF || err == io.EOF
}
func (sh *ServerHandlers) Validate() { func (sh *ServerHandlers) Validate() {
} }

7
util.go Normal file
View File

@ -0,0 +1,7 @@
package server
import "io"
func IsClientDisconnect(err error) bool {
return err == io.ErrUnexpectedEOF || err == io.EOF
}