I'm a little confused about how reading data into a stream works in asio. My main questions are:
- What happens if there are multiple asynchronous writes from one computer going on at the same time, and only one asynchronous read on the receiving computer. Over a TCP protocol, is there any chance that the data will get interleaved?
- How does the ASIO library know when to call the handler that handles new data in the read stream? Would it call on every received byte? When the client disconnects?
- Are there any good (and simple) examples that use a stream, as opposed to a buffer to read from a tcp socket with asio?
thanks.