Package org.xnio.channels
Interface SimpleAcceptingChannel<C extends CloseableChannel>
- Type Parameters:
C- the channel type
- All Superinterfaces:
AutoCloseable,Channel,Closeable,CloseableChannel,Configurable,InterruptibleChannel,SuspendableAcceptChannel
- All Known Subinterfaces:
AcceptingChannel<C>
public interface SimpleAcceptingChannel<C extends CloseableChannel>
extends SuspendableAcceptChannel
A channel which can accept connections.
- Author:
- David M. Lloyd
-
Field Summary
Fields inherited from interface org.xnio.channels.Configurable
EMPTY -
Method Summary
Modifier and TypeMethodDescriptionaccept()Attempt to accept a connection.ChannelListener.Setter<? extends SimpleAcceptingChannel<C>>Get the setter which can be used to change the accept listener for this channel.ChannelListener.Setter<? extends SimpleAcceptingChannel<C>>Get the setter which can be used to change the close listener for this channel.Methods inherited from interface org.xnio.channels.CloseableChannel
close, getWorkerMethods inherited from interface org.xnio.channels.Configurable
getOption, setOption, supportsOptionMethods inherited from interface org.xnio.channels.SuspendableAcceptChannel
awaitAcceptable, awaitAcceptable, getAcceptThread, getIoThread, isAcceptResumed, resumeAccepts, suspendAccepts, wakeupAccepts
-
Method Details
-
accept
Attempt to accept a connection.- Returns:
- the new connection, or
nullif none is available - Throws:
IOException- if an I/O error occurs
-
getAcceptSetter
ChannelListener.Setter<? extends SimpleAcceptingChannel<C>> getAcceptSetter()Get the setter which can be used to change the accept listener for this channel.- Specified by:
getAcceptSetterin interfaceSuspendableAcceptChannel- Returns:
- the setter
-
getCloseSetter
ChannelListener.Setter<? extends SimpleAcceptingChannel<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 interfaceCloseableChannel- Specified by:
getCloseSetterin interfaceSuspendableAcceptChannel- Returns:
- the setter
-