Package org.xnio.channels
Interface ConnectedChannel
- All Superinterfaces:
AutoCloseable,BoundChannel,Channel,Closeable,CloseableChannel,Configurable,InterruptibleChannel
- All Known Subinterfaces:
ConnectedMessageChannel,ConnectedSslStreamChannel,ConnectedStreamChannel,SslChannel
- All Known Implementing Classes:
AssembledConnectedChannel,AssembledConnectedMessageChannel,AssembledConnectedSslStreamChannel,AssembledConnectedStreamChannel,AssembledSslChannel,Connection,FramedMessageChannel,JsseSslConnection,JsseSslStreamConnection,MessageConnection,SslConnection,StreamConnection
A channel that has a local and peer endpoint address.
-
Field Summary
Fields inherited from interface org.xnio.channels.Configurable
EMPTY -
Method Summary
Modifier and TypeMethodDescriptionChannelListener.Setter<? extends ConnectedChannel>Get the setter which can be used to change the close listener for this channel.Get the peer address of this channel.<A extends SocketAddress>
AgetPeerAddress(Class<A> type) Get the peer address of a given type, ornullif the address is not of that type.Methods inherited from interface org.xnio.channels.BoundChannel
getLocalAddress, getLocalAddressMethods inherited from interface org.xnio.channels.CloseableChannel
close, getIoThread, getWorkerMethods inherited from interface org.xnio.channels.Configurable
getOption, setOption, supportsOption
-
Method Details
-
getPeerAddress
SocketAddress getPeerAddress()Get the peer address of this channel.- Returns:
- the peer address
-
getPeerAddress
Get the peer address of a given type, ornullif the address is not of that type.- Parameters:
type- the address type class- Returns:
- the peer address, or
nullif unknown
-
getCloseSetter
ChannelListener.Setter<? extends ConnectedChannel> getCloseSetter()Get the setter which can be used to change the close listener for this channel. If the channel is already closed, then the listener will not be called.- Specified by:
getCloseSetterin interfaceBoundChannel- Specified by:
getCloseSetterin interfaceCloseableChannel- Returns:
- the setter
-