Re: [go-nuts] A question about reading of TCP sockets.

2017-05-20 Thread Enrico Maria Fusi
Hi I was under this impression, too I think for my purposes is Better to use a TLV based stream, also because I am familiar with TLVs. Which means, a naturally delimited syntax, as you said. Thanks for the clarification on tcp read behavior. Thank On 20 May 2017 17:39, "Jesper Louis Andersen" <

Re: [go-nuts] A question about reading of TCP sockets.

2017-05-20 Thread Jesper Louis Andersen
Hi, TCP is a stream-oriented protocol. When you send your 1516 bytes, the receiver may read anything from 0 to 1516 bytes when they execute the read. The reason is that the operating system kernels in both ends are free to "chop up" the stream at any point. Furthermore, transmission errors and ret

[go-nuts] A question about reading of TCP sockets.

2017-05-20 Thread fusi . enrico . maria
Hello All first I apologize for my English, I'm not a native speaker. I have a question about how golang reads the sockets in tcp. Imagine I send , using a conn.Write(buffer), a buffer which has the (unpredictable) size from 80 Bytes to 1516. Now, if I do something like this (after creating "l