I am facing an issue with Socket Programming in a Android App.
I face a problem while receiving the data from the socket connection's input stream. The problem is :
From the socket connection that is opened, I obtain the input-Stream, and parse the data whenever it is available.
And like this:
However, this input-stream then closes with a end-of-stream character (-1) if there is no data sent for a long time(~3 mins) from the remote-server.
Due to this input-stream closure, I am no longer able to receive the data that is sent by the server later.
I have debugged it and found the socket-connection is still open, and also the remote-server is broadcasting data (since it is a broadcast, the data
could be sent at any time, with very small to very big time gaps in between data signals)
Can you please advise me in overcoming this issue, such that the android application can parse the data which could be broadcasted by the remote-server at
any point of time.
posted 2 years ago
Have you tried changing the timeout on the socket ?