Do I need to tell Apache Tomcat to keep a Websocket connection open?

tomcat, websocket

Solution

Tomcat has several issues with WebSocket, and one of them is it close the connection after 20 seconds (this is the connectTimeout value in server.xml). Increase that value to workaround the issue.

-- Jeanfrancois

Problem

I am trying the Apache Tomcat Websocket Implementation. The Problem is, that the connection always gets closed after at most 30 seconds of idle time. Do I need to configure Tomcat so that it keeps the connection open? If so how can I do that? I tried to set up the connectionTimeout in the Connector element of the server.xml for the HTTP protocol. That had no effect, but I don't know if it just doesn't work because I didn't adjust the protocol attribute to something websocket specific (since I don't know what that protocol declaration looks like). Or is it perhaps a client-side problem. Thanks for helping, Leo edit: This Problem has been solved with Tomcat 7.0.28 (Bug Description, changelog)

Original source