Now server answers with received message and prefix message before that

This commit is contained in:
qowevisa 2024-03-14 00:05:29 +02:00
parent 4be3db88e6
commit db5136a33e

View File

@ -62,7 +62,8 @@ func handleClient(conn net.Conn) {
break
}
log.Printf("server: conn: echo %q\n", string(buf[:n]))
_, err = conn.Write(buf[:n])
answer := append([]byte("Hello! I see your message:"), buf[:n]...)
_, err = conn.Write(answer)
if err != nil {
log.Printf("server: conn: write: %s", err)
break