Top Description Methods
org.apache.hc.core5.http

public Interface HttpConnection

extends SocketModalCloseable
Known Direct Subinterfaces
org.apache.hc.core5.http.impl.nio.HttpConnectionEventHandler, org.apache.hc.core5.http.io.BHttpConnection
Known Direct Implementers
org.apache.hc.core5.http.impl.nio.AbstractHttp1StreamDuplexer
Imports
java.io.IOException, java.net.SocketAddress, javax.net.ssl.SSLSession

A generic HTTP connection, useful on client and server side.
Since
4.0

Method Summary

Modifier and TypeMethod and Description
public void
close()

Redeclares java.io.Closeable.close.

Closes this connection gracefully.
public EndpointDetails

Returns:

this connection's endpoint details.
getEndpointDetails
()

Returns this connection's endpoint details.

public SocketAddress

Returns:

this connection's local address or null if it is not bound yet.
getLocalAddress
()

Returns this connection's local address or null if it is not bound yet.

public ProtocolVersion

Returns:

this connection's protocol version or null if unknown.
getProtocolVersion
()

Returns this connection's protocol version or null if unknown.

public SocketAddress

Returns:

this connection's remote address or null if it is not connected yet or unconnected.
getRemoteAddress
()

Returns this connection's remote address or null if it is not connected yet or unconnected.

public SSLSession

Returns:

this connection's SSL session or null if TLS has not been activated.
getSSLSession
()

Returns this connection's SSL session or null if TLS has not been activated.

public boolean

Returns:

true if it is open, false if it is closed.
isOpen
()

Checks if this connection is open.

Inherited from org.apache.hc.core5.http.SocketModalCloseable:
getSocketTimeoutsetSocketTimeout

Method Detail

closeback to summary
public void close() throws IOException

Redeclares java.io.Closeable.close.

Closes this connection gracefully. This method will attempt to flush the internal output buffer prior to closing the underlying socket. This method MUST NOT be called from a different thread to force shutdown of the connection. Use shutdown instead.

Annotations
@Override
Exceptions
IOException:

Doc from java.io.Closeable.close.

if an I/O error occurs

getEndpointDetailsback to summary
public EndpointDetails getEndpointDetails()

Returns this connection's endpoint details.

Returns:EndpointDetails

this connection's endpoint details.

getLocalAddressback to summary
public SocketAddress getLocalAddress()

Returns this connection's local address or null if it is not bound yet.

Returns:SocketAddress

this connection's local address or null if it is not bound yet.

Since
5.0
getProtocolVersionback to summary
public ProtocolVersion getProtocolVersion()

Returns this connection's protocol version or null if unknown.

Returns:ProtocolVersion

this connection's protocol version or null if unknown.

Since
5.0
getRemoteAddressback to summary
public SocketAddress getRemoteAddress()

Returns this connection's remote address or null if it is not connected yet or unconnected.

Returns:SocketAddress

this connection's remote address or null if it is not connected yet or unconnected.

Since
5.0
getSSLSessionback to summary
public SSLSession getSSLSession()

Returns this connection's SSL session or null if TLS has not been activated.

Returns:SSLSession

this connection's SSL session or null if TLS has not been activated.

isOpenback to summary
public boolean isOpen()

Checks if this connection is open.

Returns:boolean

true if it is open, false if it is closed.