When I was using regular Sockets, I could call getInputStream() and use available() to see how many bytes were available. I switched to SSLSocket, but now available() always returns 0 for some reason. When I read instead, I can still get data. How can I tell if there is data available in an SSLSocket so that I can service it without blocking if there is no data?
Notes:
- I cannot call read() on the InputStream or the thread will block. I would like non-blocking in my implementation.
- available() returns 0 even though there is data for SSLSocket's InputStream.