boost asio async_receive completion handler getting called with 0 bytes_transferred with out any error [closed]

StackOverflow https://stackoverflow.com/questions/21988084

  •  15-10-2022
  •  | 
  •  

Question

I am debugging a boost asio unix domain protocol client, after i issue async_receive , the completion handler gets called infinitely with 0 bytes_transferred, there are no errors passed to the completion handler. the error code is success.

Was it helpful?

Solution

Finally i got the problem nailed , i am posting the answer here , just incase some body else might very likely run into the same problem.

The completion handler falls into infinite loop if the boost::asio::buffer passed to the async_receive function is of length 0. In my case i was passing a vector of size 0.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top