bufio.NewReader

On Mon, 2017-12-18 at 05:11 -0800, Tamás Gulácsi wrote:
> >         n, err := sock.Read(buf)
> >
> >
> This will be slow: TCP is a streaming protocol, so this Read can read
> any 
> length between 0 (! yes !) and 1024 bytes.
> Use buffering (bytes.NewReader) and some kind of message separation
> (e.g. 
> bufio.Scanner for a line-oriented protocol).

-- 
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 golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to