2013-11-24 30 views
1

我用tomcat 8 websockets創建了一個簡單的項目。這裏是一個片段:Tomcat 8 - websockets會話和複製

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"); 

正如你所看到的,與對象會話(javax.websocket.session) 我的問題是,WebSocket的利用當我進入tomcat的管理應用程式,我不能上看到任何會議顯示器。 我相信因爲它尋找httpSession而不是websocket sesssion。

所以2個問題:

1)有沒有一種方法來監視Tomcat實例,這些WebSocket的會議?

2)有沒有類似sesssion複製(httpSession)的websocket會話的方式?

謝謝!

回答