Re: WebSocket connection silently drops

2020-09-13 Thread Christopher Dodunski (Apache Tomcat)
It turns out that I was premature in concluding connections were 
silently getting dropped.


I left the client application running for another quarter hour after it 
stopped displaying message updates from the server.  On shutting it 
down, the server immediately recorded that the client had just 
disconnected.  This indicates that the WebSocket connection is not being 
silently dropped afterall, rather the client is becoming deaf to inbound 
messages after a few minutes.


Exactly why this is is a mystery.  But evidently it is a Tyrus rather 
than a Tomcat or network issue (they communicate across the internet, to 
answer your earlier question).


Regards,

Chris.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



WebSocket connection silently drops

2020-09-13 Thread Christopher Dodunski (Apache Tomcat)

Hi,

I have a desktop application that, using the org.glassfish.tyrus 
WebSocket implementation, connects and talks with a parent web 
application running on Tomcat.  All runs well for a while but, after 
data transfer falls quiet for a few minutes, the connection gets 
silently dropped (nothing in the logs).


The ServerEndpoint onOpen() method sets the session to never timeout: 
session.setMaxIdleTimeout(0).  But this hasn't had the desired effect.


I've not (yet) implemented a game of ping pong to keep connections alive 
over long periods of time.  Still, I'd like to know why connections 
consistently get dropped after just a matter of minutes, and whether 
this can be resolved with a simple configuration change.


Web.xml is configured to keep sessions alive for 720 minutes, so the 
problem is not there.



720


WebSocket connections are handled by Tomcat port 8080, and as you can 
see this is set in server.xml to timeout after just 20 seconds.  I 
haven't tried extending this for fear it may have undesirable side 
effects.  Anyway, connections are dropping after several minutes, not 20 
seconds.


protocol="HTTP/1.1"

   connectionTimeout="2"
   redirectPort="8443" />

Any suggestions much appreciated.

Regards,

Chris.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org