Details
-
Bug
-
Resolution: Done
-
Major
-
8.0.0.Final
-
None
-
None
Description
The onClose method of the websocket endpoints does not receive valid CloseReason, it is always null.
With GlassFish 4.0, the CloseReason is not null and correctly reflects the code and message used to close the wensocket from the client side.
Simplified code sample of the endpoint:
@ServerEndpoint(value = "/test", configurator = MyConfigurator.class)
public class MyEndpoint {
// onOpen, onMessage and onError, LOGGER are omitted
@OnClose
public void onClose(Session session, CloseReason reason) {
LOGGER.debug("onClose(sessionId={}, reason={})", session.getId(), reason);
}
}