Linux - ioctl with FIONREAD always 0

后端 未结 5 1381
滥情空心
滥情空心 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:57

    For those who are using a docker I had the same issue when I tried to send packets from outside (Ubuntu 16.04 in this case) into the docker's interface (docker0 in this case) using tcpreplay.

    The workaround was to run tcpreplay inside the docker.

    I do not know if ioctl() is supported in docker or not, so it is not a solution.

提交回复
热议问题