/** * When a <code>Websocket</code> is created it automatically registers an event handler with the event bus - the ID of that * handler is given by this method. * <p> * Given this ID, a different event loop can send a binary frame to that event handler using the event bus and * that buffer will be received by this instance in its own event loop and written to the underlying connection. This * allows you to write data to other WebSockets which are owned by different event loops. * @return the binary handler id */ public String binaryHandlerID() { String ret = delegate.binaryHandlerID(); return ret; }
/** * When a <code>Websocket</code> is created it automatically registers an event handler with the event bus - the ID of that * handler is given by this method. * <p> * Given this ID, a different event loop can send a binary frame to that event handler using the event bus and * that buffer will be received by this instance in its own event loop and written to the underlying connection. This * allows you to write data to other WebSockets which are owned by different event loops. * @return the binary handler id */ public String binaryHandlerID() { String ret = delegate.binaryHandlerID(); return ret; }
private String getBinaryWriteHandlerId() { return delegate.binaryHandlerID(); }
protected void closeConnection() { logger.debug("web-socket will be closed ... " + netSocket.binaryHandlerID() + " " + netSocket.textHandlerID()); if(session!=null) { session.handleWillMessage(); } netSocket.close(); } }
public void start() { netSocket.handler(this); netSocket.exceptionHandler(event -> { String clientInfo = getClientInfo(); logger.info(clientInfo + ", web-socket closed ... " + netSocket.binaryHandlerID() + " error: " + event.getMessage()); handleWillMessage(); shutdown(); }); netSocket.closeHandler(aVoid -> { String clientInfo = getClientInfo(); logger.info(clientInfo + ", web-socket closed ... "+ netSocket.binaryHandlerID() +" "+ netSocket.textHandlerID()); shutdown(); }); }