Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 contextDestroyed 中停止 tomcat 时,有什么优雅的方法可以拒绝传入的 websocket 连接?
提前谢谢。
一般的想法是,当收到 Tomcat 关闭信号时,所有现有请求都已完成服务,但不允许其他新请求进入。在讨论此问题时,Mark Thomas(Tomcat 开发人员)提到之前可能存在一个小错误到版本 7.0.12,其中连接器在关闭时抛出异常。
您可能还想查看此图。
上面说过,Tomcat 应该完全按照您的意愿行事,除非您有特殊要求。但是您需要更详细地解释您的期望以及实际发生的情况。