How many packets or bytes are in the socket receive queue?

后端 未结 3 1611
灰色年华
灰色年华 2021-01-03 02:22

Calling getsockopt with SO_RCVBUF will return the allocated size of the socket receive buffer.

I am curious to know if it is possible to

3条回答
  •  情话喂你
    2021-01-03 02:36

    use the SIOCINQ ioctl() on the socket to learn the amount of queued incoming bytes.

    Similarly there's SIOCOUTQ for querying the send buffer.

提交回复
热议问题