https://issues.apache.org/bugzilla/show_bug.cgi?id=54942
Bug ID: 54942
Summary: a design question of websocket
Product: Tomcat 7
Version: 7.0.39
Hardware: PC
OS: Windows XP
Status: NEW
Severity: normal
Priority: P2
Component: Catalina
Assignee: [email protected]
Reporter: [email protected]
Classification: Unclassified
hi,boys:
there is a design question in the bound!
for example:
in my wesocketservlet, i write a loop in broadcast.
eg.
private void broadcast(String message) throws IOException{
String mmstr = "";
while(true) {
for (ChatMessageInbound connection : connections) {
String msg = "update:[" + mmstr +"] is over";
CharBuffer buffer = CharBuffer.wrap(msg);
connection.getWsOutbound().writeTextMessage(buffer);
}
}
}
now,how did the servlet know it when the brower is closed?
i hope you could add a boolean in the connection so that i can filter the
connection,then change the condition of while
(true).or just a empty while with a Thread.sleep().
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]