Moving to unprivileged port.
This commit is contained in:
@@ -8,6 +8,6 @@ import (
|
||||
func main() {
|
||||
fmt.Println("Server v0.04")
|
||||
server := server.NewServer()
|
||||
server.Start(501)
|
||||
server.Start(5001)
|
||||
|
||||
}
|
||||
|
||||
@@ -82,7 +82,11 @@ func (s *Server) HandleClient(conn net.Conn, id int) {
|
||||
lengthBuf := make([]byte, 4)
|
||||
_, err := io.ReadFull(conn, lengthBuf)
|
||||
if err != nil {
|
||||
fmt.Println("failed to read length prefix: ", err)
|
||||
if err == io.EOF {
|
||||
fmt.Println("client closed connection")
|
||||
} else {
|
||||
fmt.Println("failed to read length prefix: ", err)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user