Java Code Examples for io.vertx.ext.web.handler.sockjs.SockJSSocket#exceptionHandler()
The following examples show how to use
io.vertx.ext.web.handler.sockjs.SockJSSocket#exceptionHandler() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SockJSPushHandler.java From vertx-vaadin with MIT License | 5 votes |
private void initSocket(SockJSSocket sockJSSocket, RoutingContext routingContext, PushSocket socket) { sockJSSocket.handler(data -> sessionHandler.handle( new SockJSRoutingContext(routingContext, rc -> onMessage(new PushEvent(socket, rc, data))) )); sockJSSocket.endHandler(unused -> sessionHandler.handle( new SockJSRoutingContext(routingContext, rc -> onDisconnect(new PushEvent(socket, rc, null))) )); sockJSSocket.exceptionHandler(t -> sessionHandler.handle( new SockJSRoutingContext(routingContext, rc -> onError(new PushEvent(socket, routingContext, null), t)) )); }
Example 2
Source File: SockJSPushHandler.java From vertx-vaadin with MIT License | 5 votes |
private void initSocket(SockJSSocket sockJSSocket, RoutingContext routingContext, PushSocket socket) { sockJSSocket.handler(data -> sessionHandler.handle( new SockJSRoutingContext(routingContext, rc -> onMessage(new PushEvent(socket, rc, data))) )); sockJSSocket.endHandler(unused -> sessionHandler.handle( new SockJSRoutingContext(routingContext, rc -> onDisconnect(new PushEvent(socket, rc, null))) )); sockJSSocket.exceptionHandler(t -> sessionHandler.handle( new SockJSRoutingContext(routingContext, rc -> onError(new PushEvent(socket, routingContext, null), t)) )); }
Example 3
Source File: ServiceHandler.java From Lealone-Plugins with Apache License 2.0 | 5 votes |
@Override public void handle(SockJSSocket sockJSSocket) { sockJSSocket.endHandler(v -> { removeConnection(sockJSSocket.hashCode()); }); sockJSSocket.exceptionHandler(t -> { removeConnection(sockJSSocket.hashCode()); logger.error("sockJSSocket exception", t); }); sockJSSocket.handler(buffer -> { Buffer ret = ServiceHandler.handle(sockJSSocket, buffer.getString(0, buffer.length())); sockJSSocket.end(ret); }); }