Java Code Examples for io.vertx.ext.web.handler.sockjs.SockJSSocket#writeHandlerID()

The following examples show how to use io.vertx.ext.web.handler.sockjs.SockJSSocket#writeHandlerID() . 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 6 votes vote down vote up
private void onConnect(SockJSSocket sockJSSocket) {
    RoutingContext routingContext = CurrentInstance.get(RoutingContext.class);

    String uuid = sockJSSocket.writeHandlerID();
    connectedSocketsLocalMap.put(uuid, sockJSSocket);
    PushSocket socket = new PushSocketImpl(sockJSSocket);

    initSocket(sockJSSocket, routingContext, socket);

    // Send an ACK
    socket.send("ACK-CONN|" + uuid);

    sessionHandler.handle(new SockJSRoutingContext(routingContext, rc ->
        callWithUi(new PushEvent(socket, routingContext, null), establishCallback)
    ));
}
 
Example 2
Source File: SockJSPushHandler.java    From vertx-vaadin with MIT License 6 votes vote down vote up
private void onConnect(SockJSSocket sockJSSocket) {
    RoutingContext routingContext = CurrentInstance.get(RoutingContext.class);

    String uuid = sockJSSocket.writeHandlerID();
    connectedSocketsLocalMap.put(uuid, sockJSSocket);
    PushSocket socket = new PushSocketImpl(sockJSSocket);

    initSocket(sockJSSocket, routingContext, socket);

    // Send an ACK
    socket.send("ACK-CONN|" + uuid);

    sessionHandler.handle(new SockJSRoutingContext(routingContext, rc ->
        callWithUi(new PushEvent(socket, routingContext, null), establishCallback)
    ));
}
 
Example 3
Source File: SockJSPushHandler.java    From vertx-vaadin with MIT License 4 votes vote down vote up
PushSocketImpl(SockJSSocket socket) {
    this.socketUUID = socket.writeHandlerID();
    this.remoteAddress = socket.remoteAddress().toString();
}
 
Example 4
Source File: SockJSPushHandler.java    From vertx-vaadin with MIT License 4 votes vote down vote up
PushSocketImpl(SockJSSocket socket) {
    this.socketUUID = socket.writeHandlerID();
    this.remoteAddress = socket.remoteAddress().toString();
}