Blocking socket returns EAGAIN

前端 未结 4 375
孤独总比滥情好
孤独总比滥情好 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条回答
  •  猫巷女王i
    2020-12-10 17:34

    Is it possible that you're using MSG_DONTWAIT is being specified as part of your flags? The man page says EAGAIN will occur if no data is available and this flag is specified.

    If you really want to force a block until the recv() is somewhat successful, you may wish to use the MSG_WAITALL flag.

提交回复
热议问题