I have Socket stream and I need to use in.read()
from stream function even if no data available.
I need this approach because blocking read
function raises exception if the socket is disconnected and this is the only way to know if socket is alive.
I found that in.read()
is waiting for data for approximately 2 min. and raises SocketTimeoutException
if no data is available.
Can I somehow set read from socket timeout value?