I have figured out that I must use ioctl. There are similar questions here:
- How to tell how much data is in a Socket's send buffer
- Determing the number of bytes ready to be recv()'d
My questions are:
- What is an equivalent to FIONREAD in Python? How do I call sock.ioctl() to obtain the amount of bytes available?
- What if I am using Python 2.5 on Windows? socket.ioctl is new in version 2.6.