29 #if defined(__linux__)
30 #include <linux/sockios.h>
31 #include <sys/ioctl.h>
32 #elif defined(__APPLE__)
33 #include <sys/socket.h>
42 #if defined(__linux__)
43 if (ioctl(fd, SIOCOUTQ, &queueLength) < 0) {
46 #elif defined(__APPLE__)
47 socklen_t queueLengthSize =
sizeof(queueLength);
48 if (getsockopt(fd, SOL_SOCKET, SO_NWRITE, &queueLength, &queueLengthSize) < 0) {
constexpr ssize_t QUEUE_UNSUPPORTED
Indicates that the transport does not support reading the queue capacity/length.
constexpr ssize_t QUEUE_ERROR
Indicates that the transport was unable to retrieve the queue capacity/length.
ssize_t getTxQueueLength(int fd)
Obtain send queue length from a specified system socket.