0

Is there any elegant way how to refuse incoming websocket connections when stopping tomcat in contextDestroyed?

Thanx in advance.

1 Answer 1

1

The general idea is that when Tomcat shutdown signal is received, all existing requests are finished to be served but no other new requests are allowed in. In a discussion about this, Mark Thomas (Tomcat developer) mentioned that there might be a slight bug prior to version 7.0.12 where connector was throwing an exception when shutting down.

You might also want to look at this diagram.

Above said, Tomcat should behave exactly as you wish, unless you have special requirements. But you need to explain in more details what you expect and what is actually happening.

1
  • Hi mindas, thank you for your answer, I found it very useful. It seems that all those incoming requests from clients to server are causing some memory leaks(log4j and others). This happens because of particularity of our system. I did little work around and I close all WsOutbounds connected and those memory leaks appear to be gone, but I will continue investigating.
    – stebetko
    Commented May 21, 2013 at 6:50

Not the answer you're looking for? Browse other questions tagged or ask your own question.