Examples of CloseStatus


Examples of org.eclipse.jetty.websocket.api.CloseStatus

    private void closeConnection(Session session, GuacamoleStatus guac_status) {

        try {
            int code = guac_status.getWebSocketCode();
            String message = Integer.toString(guac_status.getGuacamoleStatusCode());
            session.close(new CloseStatus(code, message));
        }
        catch (IOException e) {
            logger.debug("Unable to close WebSocket connection.", e);
        }
View Full Code Here

Examples of org.springframework.web.socket.CloseStatus

    }
  }

  @OnWebSocketClose
  public void onWebSocketClose(int statusCode, String reason) {
    CloseStatus closeStatus = new CloseStatus(statusCode, reason);
    try {
      this.webSocketHandler.afterConnectionClosed(this.wsSession, closeStatus);
    }
    catch (Throwable t) {
      logger.error("Unhandled error for " + this.wsSession, t);
View Full Code Here

Examples of org.springframework.web.socket.CloseStatus

    assertEquals(SockJsFrame.closeFrameGoAway(), this.session.getSockJsFramesWritten().get(0));

    assertEquals(1, this.session.getNumberOfLastActiveTimeUpdates());
    assertTrue(this.session.didCancelHeartbeat());

    assertEquals(new CloseStatus(3000, "Go away!"), this.session.getCloseStatus());
    assertClosed();
    verify(this.webSocketHandler).afterConnectionClosed(this.session, new CloseStatus(3000, "Go away!"));
  }
View Full Code Here

Examples of org.springframework.web.socket.CloseStatus

    this.session.delegateConnectionEstablished();
    this.session.setActive(true);
    this.session.close();

    assertEquals(new CloseStatus(3000, "Go away!"), this.session.getCloseStatus());
    assertClosed();
  }
View Full Code Here

Examples of org.springframework.web.socket.CloseStatus

        if (sockJsSession.isDisconnected()) {
          sockJsSession.afterTransportClosed(null);
        }
        else {
          sockJsSession.handleTransportError(failure);
          sockJsSession.afterTransportClosed(new CloseStatus(1006, failure.getMessage()));
        }
      }
    };

  }
View Full Code Here

Examples of org.springframework.web.socket.CloseStatus

      if (this.session.isDisconnected()) {
        this.session.afterTransportClosed(null);
      }
      else {
        this.session.handleTransportError(failure);
        this.session.afterTransportClosed(new CloseStatus(1006, failure.getMessage()));
      }
    }
View Full Code Here

Examples of org.springframework.web.socket.CloseStatus

      if (this.sockJsSession.isDisconnected()) {
        this.sockJsSession.afterTransportClosed(null);
      }
      else {
        this.sockJsSession.handleTransportError(failure);
        this.sockJsSession.afterTransportClosed(new CloseStatus(1006, failure.getMessage()));
      }
    }
View Full Code Here

Examples of org.springframework.web.socket.CloseStatus

   */
  Runnable getTimeoutTask() {
    return new Runnable() {
      @Override
      public void run() {
        closeInternal(new CloseStatus(2007, "Transport timed out"));
      }
    };
  }
View Full Code Here

Examples of org.springframework.web.socket.CloseStatus

      if (logger.isDebugEnabled()) {
        logger.debug("Open frame received in " + getId() + " but we're not" +
            "connecting (current state=" + this.state + "). The server might " +
            "have been restarted and lost track of the session.");
      }
      closeInternal(new CloseStatus(1006, "Server lost session"));
    }
  }
View Full Code Here

Examples of org.springframework.web.socket.CloseStatus

      }
    }
  }

  private void handleCloseFrame(SockJsFrame frame) {
    CloseStatus closeStatus = CloseStatus.NO_STATUS_CODE;
    try {
      String[] data = getMessageCodec().decode(frame.getFrameData());
      if (data.length == 2) {
        closeStatus = new CloseStatus(Integer.valueOf(data[0]), data[1]);
      }
      if (logger.isDebugEnabled()) {
        logger.debug("Processing SockJS close frame with " + closeStatus + " in " + this);
      }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.