Package io.servicetalk.transport.api
Interface ConnectionInfo
- All Known Subinterfaces:
ConnectionContext
,GrpcServiceContext
,HttpConnectionContext
,NettyConnection<Read,
,Write> NettyConnectionContext
- All Known Implementing Classes:
DefaultNettyConnection
,DelegatingConnectionContext
,DelegatingHttpConnectionContext
,DelegatingHttpServiceContext
,HttpServiceContext
,NettyPipelinedConnection
public interface ConnectionInfo
Provides information about a connection.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Provides information about the network protocol. -
Method Summary
Modifier and TypeMethodDescriptionGet theExecutionContext
for thisConnectionInfo
.TheSocketAddress
to which the associated connection is bound.protocol()
Get theConnectionInfo.Protocol
for thisConnectionInfo
.TheSocketAddress
to which the associated connection is connected.<T> T
socketOption
(SocketOption<T> option) default SslConfig
Get theSslConfig
for this connection.Get theSSLSession
for this connection.
-
Method Details
-
localAddress
SocketAddress localAddress()TheSocketAddress
to which the associated connection is bound.- Returns:
- The
SocketAddress
to which the associated connection is bound.
-
remoteAddress
SocketAddress remoteAddress()TheSocketAddress
to which the associated connection is connected.- Returns:
- The
SocketAddress
to which the associated connection is connected.
-
sslConfig
Get theSslConfig
for this connection.- Returns:
- The
SslConfig
if SSL/TLS is configured, ornull
otherwise.
-
sslSession
Get theSSLSession
for this connection.- Returns:
- The
SSLSession
if SSL/TLS is enabled, ornull
otherwise.
-
executionContext
ExecutionContext<?> executionContext()Get theExecutionContext
for thisConnectionInfo
.The
ExecutionContext.ioExecutor()
will represent the thread responsible for IO for thisConnectionInfo
. Note that this maybe different that what was used to create this object because at this time a specificIoExecutor
has been selected.- Returns:
- the
ExecutionContext
for thisConnectionInfo
.
-
socketOption
- Type Parameters:
T
- the type of theSocketOption
value.- Parameters:
option
-SocketOption
to get.- Returns:
- the
SocketOption
value of typeT
for thisConnectionInfo
ornull
if thisSocketOption
is not supported by thisConnectionInfo
. - See Also:
-
protocol
ConnectionInfo.Protocol protocol()Get theConnectionInfo.Protocol
for thisConnectionInfo
.- Returns:
- the
ConnectionInfo.Protocol
for thisConnectionInfo
.
-