【发布时间】:2013-12-09 05:35:12
【问题描述】:
我用 tomcat 8 websockets 创建了一个简单的项目。这是一个sn-p:
public void onMessage(String message, Session session)
throws IOException, InterruptedException {
// Print the client message for testing purposes
System.out.println("Received: " + message);
// Send the first message to the client
session.getBasicRemote().sendText("This is the first server message");
如您所见,websocket 使用对象 Session (javax.websocket.session) 我的问题是,当我进入 tomcat 的管理器应用程序时,我在监视器上看不到任何会话。 我相信因为它寻找的是 httpSession 而不是 websocket 会话。
所以 2 个问题:
1) 有没有办法在 tomcat 实例上监控这些 websocket 会话?
2) websocket 会话是否也有类似会话复制 (httpSession) 的方法?
谢谢!
【问题讨论】: