Linux - ioctl with FIONREAD always 0

后端 未结 5 1382
滥情空心
滥情空心 2021-02-05 13:02

I\'m trying to get to know how many bytes there are readable at my TCP socket. I am calling ioctl with the Flag \"FIONREAD\" which should actually give me this value. When I ca

5条回答
  •  一向
    一向 (楼主)
    2021-02-05 13:58

    You're doing nothing wrong, if you are using blocking I/O recv() will block untill the data is available.

提交回复
热议问题