a short explanaition of what i have.
The Problem is that when i don't sent data for 30 sec the Client seems to close the Stream automaticly.
I've already set the Timout from 30 sec to LONG.MAX_VALUE with:
stream.setIdleTimeout(Long.MAX_VALUE);
For now I've implemented a "Heartbeat-Workaround" that pushes a simple String every 20sec so i elude the timeout.
I just want to know if this is the only way to do it. Or if I have to change some Settings i didn't found.
Thank you for every answer.
Regards!
Seems you are doing reverse HTTP long-polling, which does require a "heart-beat" to avoid that streams or connections are closed by an idle timeout.
It is normally better to do regular HTTP long polling (i.e. the client sends the heart-beat), because it allows the server to detect disconnected clients much quicker.
However, you are better off using solutions like CometD if you want to perform server-push messaging.