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.
我设置了一个自定义配置器来获取 cookie 并对其进行处理。输出将添加到配置的用户属性中。
在@OnOpen-annotated 方法中,我将该值与路径中的值进行比较。如果不匹配,那么我想关闭套接字,原因是 1008,违反策略。
@OnOpen
实现这一目标的最佳方法是什么?
我可以:
@OnClose
@OnError
我希望关闭套接字并让 Tyrus 清理资源。我查看了文档,但没有看到如何清理资源的答案。任何帮助将不胜感激。谢谢。
永远不要手动调用@OnClose- 这不会完成任何事情。
见Session.close(CloseReason)。
Session.close(CloseReason)