Now server answers with received message and prefix message before that
This commit is contained in:
parent
4be3db88e6
commit
db5136a33e
|
@ -62,7 +62,8 @@ func handleClient(conn net.Conn) {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
log.Printf("server: conn: echo %q\n", string(buf[:n]))
|
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 {
|
if err != nil {
|
||||||
log.Printf("server: conn: write: %s", err)
|
log.Printf("server: conn: write: %s", err)
|
||||||
break
|
break
|
||||||
|
|
Loading…
Reference in New Issue
Block a user