-
- Type Parameters:
C- the channel type
- All Superinterfaces:
java.lang.AutoCloseable,BoundChannel,java.nio.channels.Channel,java.io.Closeable,CloseableChannel,Configurable,java.nio.channels.InterruptibleChannel,SimpleAcceptingChannel<C>,SuspendableAcceptChannel
public interface AcceptingChannel<C extends ConnectedChannel> extends BoundChannel, SimpleAcceptingChannel<C>
A channel which can accept inbound connections from remote endpoints.- Author:
- David M. Lloyd
-
-
Field Summary
-
Fields inherited from interface org.xnio.channels.Configurable
EMPTY
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Caccept()Attempt to accept a connection.ChannelListener.Setter<? extends AcceptingChannel<C>>getAcceptSetter()Get the setter which can be used to change the accept listener for this channel.ChannelListener.Setter<? extends AcceptingChannel<C>>getCloseSetter()Get the setter which can be used to change the close listener for this channel.-
Methods inherited from interface org.xnio.channels.BoundChannel
getLocalAddress, getLocalAddress
-
Methods inherited from interface org.xnio.channels.CloseableChannel
close, getWorker
-
Methods inherited from interface org.xnio.channels.Configurable
getOption, setOption, supportsOption
-
Methods inherited from interface org.xnio.channels.SuspendableAcceptChannel
awaitAcceptable, awaitAcceptable, getAcceptThread, getIoThread, isAcceptResumed, resumeAccepts, suspendAccepts, wakeupAccepts
-
-
-
-
Method Detail
-
accept
C accept() throws java.io.IOException
Attempt to accept a connection.- Specified by:
acceptin interfaceSimpleAcceptingChannel<C extends ConnectedChannel>- Returns:
- the new connection, or
nullif none is available - Throws:
java.io.IOException- if an I/O error occurs
-
getAcceptSetter
ChannelListener.Setter<? extends AcceptingChannel<C>> getAcceptSetter()
Get the setter which can be used to change the accept listener for this channel.- Specified by:
getAcceptSetterin interfaceSimpleAcceptingChannel<C extends ConnectedChannel>- Specified by:
getAcceptSetterin interfaceSuspendableAcceptChannel- Returns:
- the setter
-
getCloseSetter
ChannelListener.Setter<? extends AcceptingChannel<C>> 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- Specified by:
getCloseSetterin interfaceSimpleAcceptingChannel<C extends ConnectedChannel>- Specified by:
getCloseSetterin interfaceSuspendableAcceptChannel- Returns:
- the setter
-
-