Moving to unprivileged port.

This commit is contained in:
2024-12-11 07:53:16 -05:00
parent 9610fc5322
commit d8d942f8e5
2 changed files with 6 additions and 2 deletions

View File

@@ -8,6 +8,6 @@ import (
func main() {
fmt.Println("Server v0.04")
server := server.NewServer()
server.Start(501)
server.Start(5001)
}

View File

@@ -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
}