recv with non-blocking socket

后端 未结 2 1531
心在旅途
心在旅途 2021-02-10 00:12

I am trying to implement non-blocking for socket recv and the problem is that I got an error -1 when there in no data but I expect to get EAGAIN error.

2条回答
  •  情话喂你
    2021-02-10 00:40

    I got an error -1 when there in no data but I expect to get EAGAIN error.

    -1 tells you there is an error. errno tells you what the error was.

提交回复
热议问题