Examples of TcpSocketLink


Examples of com.caucho.network.listen.TcpSocketLink

   * Finds the ConnectionMXBean for a given thread id
   */
  @Override
  public TcpConnectionMXBean findConnectionByThreadId(long threadId)
  {
    TcpSocketLink conn = getListenService().findConnectionByThreadId(threadId);

    if (conn != null)
      return conn.getAdmin();
    else
      return null;
  }
View Full Code Here

Examples of com.caucho.network.listen.TcpSocketLink

    return conn != null && conn.isKeepaliveAllocated();
  }

  public boolean isCometActive()
  {
    TcpSocketLink conn = _tcpConn;
   
    return conn != null && conn.isCometActive();
  }
View Full Code Here

Examples of com.caucho.network.listen.TcpSocketLink

    SocketLink conn = getConnection();

    if (! (conn instanceof TcpSocketLink))
      return;
   
    TcpSocketLink tcpConn = (TcpSocketLink) conn;
   
    if (! conn.isSecure())
      return;

    QSocket socket = tcpConn.getSocket();

    String cipherSuite = socket.getCipherSuite();
    request.setAttribute("javax.servlet.request.cipher_suite", cipherSuite);

    int keySize = socket.getCipherBits();
View Full Code Here

Examples of com.caucho.network.listen.TcpSocketLink

  @Override
  public String findSessionIdFromConnection()
  {
    SocketLink link = getConnection();
   
    TcpSocketLink tcpConn = null;
   
    if (link instanceof TcpSocketLink)
      tcpConn = (TcpSocketLink) getConnection();

    if (tcpConn == null || ! tcpConn.isSecure())
      return null;

    /*
    QSocket socket = tcpConn.getSocket(); // XXX:
    if (! (socket instanceof SSLSocket))
View Full Code Here

Examples of com.caucho.network.listen.TcpSocketLink

   * Upgrade to duplex
   */
  @Override
  public SocketLinkDuplexController startDuplex(SocketLinkDuplexListener handler)
  {
    TcpSocketLink conn = (TcpSocketLink) getConnection();

    SocketLinkDuplexController context = conn.startDuplex(handler);

    _rawInputStream.init(conn.getReadStream());
    getReadStream().setSource(_rawInputStream);
   
    return context;
  }
View Full Code Here

Examples of com.caucho.network.listen.TcpSocketLink

    if (version < HttpRequest.HTTP_1_0) {
      _request.killKeepalive("http client version " + version);
      return false;
    }

    TcpSocketLink tcpConn = null;

    if (_request.getConnection() instanceof TcpSocketLink)
      tcpConn = (TcpSocketLink) _request.getConnection();

    WebApp webApp = request.getWebApp();

    String contentType = response.getContentTypeImpl();
    String charEncoding = response.getCharacterEncodingImpl();

    WriteStream os = getRawWrite();

    int statusCode = response.getStatus();
    if (statusCode == 200) {
      if (version < HttpRequest.HTTP_1_1)
        os.write(_http10ok, 0, _http10ok.length);
      else
        os.write(_http11ok, 0, _http11ok.length);
    } else {
      if (version < HttpRequest.HTTP_1_1)
        os.printLatin1("HTTP/1.0 ");
      else
        os.printLatin1("HTTP/1.1 ");

      os.write((statusCode / 100) % 10 + '0');
      os.write((statusCode / 10) % 10 + '0');
      os.write(statusCode % 10 + '0');
      os.write(' ');
      os.printLatin1(response.getStatusMessage());
    }

    if (debug) {
      log.fine(_request.dbgId() + "HTTP/1.1 " +
               statusCode + " " + response.getStatusMessage());
    }

    boolean isUpgrade = false;

    if (tcpConn != null && tcpConn.isDuplex()) {
      isUpgrade = true;

      String upgrade = getHeader("Upgrade");

      if (upgrade != null) {
View Full Code Here

Examples of com.caucho.network.listen.TcpSocketLink

      AbstractHttpRequest httpRequest = (AbstractHttpRequest) request;

      SocketLink connection = httpRequest.getConnection();

      if (connection instanceof TcpSocketLink) {
        TcpSocketLink tcpConnection = (TcpSocketLink) connection;

        long time = Alarm.getExactTime();

        long readBytes = -1;
        long writeBytes = -1;

        readBytes = tcpConnection.getSocket().getTotalReadBytes();
        writeBytes = tcpConnection.getSocket().getTotalWriteBytes();

        ClientDisconnectException clientDisconnectException = null;

        try {
          _next.doFilter(request, response);
        } catch (ClientDisconnectException ex) {
          clientDisconnectException = ex;
        }

        time = Alarm.getExactTime() - time;

        readBytes = tcpConnection.getSocket().getTotalReadBytes() - readBytes;
        writeBytes = tcpConnection.getSocket().getTotalReadBytes() - writeBytes;

        _webApp.updateStatistics(time, (int) readBytes, (int) writeBytes, clientDisconnectException != null);

        if (clientDisconnectException != null)
          throw clientDisconnectException;
View Full Code Here

Examples of com.caucho.network.listen.TcpSocketLink

    SocketLink conn = getConnection();

    if (! (conn instanceof TcpSocketLink))
      return;
   
    TcpSocketLink tcpConn = (TcpSocketLink) conn;
   
    if (! conn.isSecure())
      return;

    QSocket socket = tcpConn.getSocket();

    String cipherSuite = socket.getCipherSuite();
    request.setAttribute("javax.servlet.request.cipher_suite", cipherSuite);

    int keySize = socket.getCipherBits();
View Full Code Here

Examples of com.caucho.network.listen.TcpSocketLink

  /**
   * For SSL connections, use the SSL identifier.
   */
  public String findSessionIdFromConnection()
  {
    TcpSocketLink tcpConn = (TcpSocketLink) getConnection();

    if (tcpConn == null || ! tcpConn.isSecure())
      return null;

    QSocket socket = tcpConn.getSocket(); // XXX:
    /*
    if (! (socket instanceof SSLSocket))
      return null;

    SSLSession sslSession = ((SSLSocket) socket).getSession();
View Full Code Here

Examples of com.caucho.network.listen.TcpSocketLink

   * Upgrade to duplex
   */
  @Override
  public TcpDuplexController startDuplex(TcpDuplexHandler handler)
  {
    TcpSocketLink conn = (TcpSocketLink) getConnection();

    TcpDuplexController context = conn.startDuplex(handler);

    _rawInputStream.init(conn.getReadStream());
    getReadStream().setSource(_rawInputStream);

    return context;
  }
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.