6 Jan
2019
6 Jan
'19
6:50 a.m.
If all async_read and async_write need a static life time buffer, do I need to worry about potential buffer overwritten before the buffer process is completed? Take an example, if a lift_time_buffer is a static buffer for async_read, when the socket gets the data, it fills data into the buffer, then the buffer is passed to higher level applications for processing, before the buffer process is completed, the socket receives more data and write the data to the buffer again since it is async process, that will certainly result data corruption. The same story could apply for async_write if one static life time buffer to async_write. Is that thought overstated? Or it needs a real concern?