use of javax.websocket.OnClose in project tutorials by eugenp.
the class ChatEndpoint method onClose.
@OnClose
public void onClose(Session session) throws IOException, EncodeException {
chatEndpoints.remove(this);
Message message = new Message();
message.setFrom(users.get(session.getId()));
message.setContent("Disconnected!");
broadcast(message);
}
use of javax.websocket.OnClose in project zeppelin by apache.
the class NotebookServer method onClose.
@OnClose
public void onClose(Session session, CloseReason closeReason) throws IOException {
NotebookSocket notebookSocket = sessionIdNotebookSocketMap.get(session.getId());
if (null == notebookSocket) {
session.close();
} else {
int code = closeReason.getCloseCode().getCode();
String reason = closeReason.getReasonPhrase();
onClose(notebookSocket, code, reason);
}
}
use of javax.websocket.OnClose in project muikku by otavanopisto.
the class CoOpsDocumentWebSocket method onClose.
@OnClose
public void onClose(final Session session, CloseReason closeReason, @PathParam("HTMLMATERIALID") String fileId, @PathParam("SESSIONID") String sessionId) {
synchronized (this) {
fileClients.get(fileId).remove(session.getId());
CoOpsSession coOpsSession = coOpsSessionController.findSessionBySessionId(sessionId);
if (coOpsSession != null) {
closeSession(coOpsSession);
}
}
}
Aggregations