Ejemplo n.º 1
0
  public void close() {
    if (closed) {
      return;
    }
    closed = true;

    /* close the underlying connection if,
     * a) the streams not set up yet, no response can be sent, or
     * b) if the wrapper output stream is not set up, or
     * c) if the close of the input/outpu stream fails
     */
    try {
      if (uis_orig == null || uos == null) {
        connection.close();
        return;
      }
      if (!uos_orig.isWrapped()) {
        connection.close();
        return;
      }
      if (!uis_orig.isClosed()) {
        uis_orig.close();
      }
      uos.close();
    } catch (IOException e) {
      connection.close();
    }
  }
Ejemplo n.º 2
0
 public SSLSession getSSLSession() {
   SSLEngine e = connection.getSSLEngine();
   if (e == null) {
     return null;
   }
   return e.getSession();
 }
Ejemplo n.º 3
0
 public InetSocketAddress getLocalAddress() {
   Socket s = connection.getChannel().socket();
   InetAddress ia = s.getLocalAddress();
   int port = s.getLocalPort();
   return new InetSocketAddress(ia, port);
 }
Ejemplo n.º 4
0
 public HttpContextImpl getHttpContext() {
   return connection.getHttpContext();
 }