WebSocket: OnClose() is never called
问题 I'm implementing an application with a WebSocket endpoint. Here is some code: @ApplicationScoped @ServerEndpoint(value="/socket", encoders = {MessageEncoder.class, CommandEncoder.class}) public class SocketEndpoint { /** Default-Logger */ private final static Logger LOG = LoggerFactory.getLogger(SocketEndpoint.class); @Inject SessionHandler sessionHandler; @OnOpen public void open(Session session, EndpointConfig config) { LOG.debug("Connected session => '{}' - '{}'", session, config);