简体   繁体   中英

boost async_read_some/async_receive behaves as if MSG_PEEK is always on

I have the following problem.

I start an async_receive on a tcp socket.
Callback is called with some data
I start another async receive on the socket.
Callback is called but the buffer also contains the data from the previous call. Behaves as if i called recv with MSG_PEEK flag, although i did no such thing.

I even tried to called the version with message flags argument = 0 and same effect.

How can i disable this behaviour?. I would like the first call to eat the data from the kernel buffers after each successfull async handler call.

Mihai

i've fixed the problem. It was a send problem. I was reusing the vector of buffers passed to async_write.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM