I write a peer-to-peer messenger. After the two peers have established a connection, they want to know whether the other has sent him a message. If not, it sends a message itself. So I need a function that tells me how many bytes are still to be read on the socket. I looked in the documentation, but didn't find it.
When I was just asking the question I was redirected to Ruby TCPSocket: Find out how much data is available. However, I use an SSL socket and it doesn't seem to have .ready?.
Does anyone know a version of the function for the SSLSocket?
I would be very happy about answers!