Il giorno venerdì 6 maggio 2016 12:17:08 UTC+2, Rayland ha scritto:
I've built a simple client that sends multiple messages and server that
reads in a loop but that will only print the first message and then does
My purpose here is to send lots of messages on the same connection and I
am not interested in a response.
Also note that the code for reading a response, in server2.go, is not ideal.
read_len, err := conn.Read(request)
but it should be, instead
n, err := conn.Read(request)
That is, you should not use the entire buffer, but only the actual data
that has been read.
You should also avoid to allocate a new buffer for each Read.
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to email@example.com.
For more options, visit https://groups.google.com/d/optout.