-
- All Superinterfaces:
java.lang.AutoCloseable
,BoundChannel
,java.nio.channels.Channel
,java.io.Closeable
,CloseableChannel
,Configurable
,java.nio.channels.InterruptibleChannel
- All Known Subinterfaces:
ConnectedMessageChannel
,ConnectedSslStreamChannel
,ConnectedStreamChannel
,SslChannel
- All Known Implementing Classes:
AssembledConnectedChannel
,AssembledConnectedMessageChannel
,AssembledConnectedSslStreamChannel
,AssembledConnectedStreamChannel
,AssembledSslChannel
,Connection
,FramedMessageChannel
,JsseSslConnection
,JsseSslStreamConnection
,MessageConnection
,SslConnection
,StreamConnection
public interface ConnectedChannel extends BoundChannel
A channel that has a local and peer endpoint address.
-
-
Field Summary
-
Fields inherited from interface org.xnio.channels.Configurable
EMPTY
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ChannelListener.Setter<? extends ConnectedChannel>
getCloseSetter()
Get the setter which can be used to change the close listener for this channel.java.net.SocketAddress
getPeerAddress()
Get the peer address of this channel.<A extends java.net.SocketAddress>
AgetPeerAddress(java.lang.Class<A> type)
Get the peer address of a given type, ornull
if the address is not of that type.-
Methods inherited from interface org.xnio.channels.BoundChannel
getLocalAddress, getLocalAddress
-
Methods inherited from interface org.xnio.channels.CloseableChannel
close, getIoThread, getWorker
-
Methods inherited from interface org.xnio.channels.Configurable
getOption, setOption, supportsOption
-
-
-
-
Method Detail
-
getPeerAddress
java.net.SocketAddress getPeerAddress()
Get the peer address of this channel.- Returns:
- the peer address
-
getPeerAddress
<A extends java.net.SocketAddress> A getPeerAddress(java.lang.Class<A> type)
Get the peer address of a given type, ornull
if the address is not of that type.- Parameters:
type
- the address type class- Returns:
- the peer address, or
null
if 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:
getCloseSetter
in interfaceBoundChannel
- Specified by:
getCloseSetter
in interfaceCloseableChannel
- Returns:
- the setter
-
-