Makefile, server entry point prototype, compareFiles function + other minor changes

This commit is contained in:
Gu://em_ 2025-04-13 12:50:35 +02:00
parent 2efb8c4130
commit c1ccb61346
10 changed files with 139 additions and 56 deletions

View file

@ -27,7 +27,7 @@ func Run() {
serverPort := strconv.Itoa(config["port"].(int))
// Listening
listener, err := net.Listen("tcp", ":" + serverPort)
listener, err := net.Listen("tcp", ":"+serverPort)
if err != nil {
panic(err)
}
@ -65,7 +65,7 @@ func handleConnection(conn net.Conn) {
log.Println("Error reading from ", clientAddress, ": ", err)
return
}
// to rm
println(message)
// fmt.Println("Received from client:", message)
@ -76,7 +76,7 @@ func handleConnection(conn net.Conn) {
// Send a response to the client
_, err = conn.Write([]byte("Server received your message\n"))
if err != nil {
log.Println("Error replying to", clientAddress,": ", err)
log.Println("Error replying to", clientAddress, ": ", err)
return
}
}