Blocking socket returns EAGAIN

前端 未结 4 369
孤独总比滥情好
孤独总比滥情好 2020-12-10 16:39

One of my projects on Linux uses blocking sockets. Things happen very serially so non-blocking would just make things more complicated. Anyway, I am finding that often a

4条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-10 17:22

    I don't suggest this as a first-attempt fix, but if you're all out of options, you can always select() on the socket with a reasonably long timeout to force it to wait for data.

提交回复
热议问题