| Package | Description |
|---|---|
| org.apache.mina.transport.socket.nio |
Socket (TCP/IP) and Datagram (UDP/IP) support based on Java
NIO (New I/O) API.
|
| Modifier and Type | Class and Description |
|---|---|
(package private) class |
NioDatagramSession
An
IoSession for datagram transport (UDP/IP). |
(package private) class |
NioSocketSession
An
IoSession for socket transport (TCP/IP). |
| Modifier and Type | Field and Description |
|---|---|
private java.util.Queue<NioSession> |
NioDatagramAcceptor.flushingSessions |
protected IoProcessor<NioSession> |
NioSession.processor
The NioSession processor
|
| Modifier and Type | Method and Description |
|---|---|
protected NioSession |
NioSocketAcceptor.accept(IoProcessor<NioSession> processor,
java.nio.channels.ServerSocketChannel handle)
Accept a client connection for a server socket and return a new
IoSession
associated with the given IoProcessor |
protected NioSession |
NioDatagramConnector.newSession(IoProcessor<NioSession> processor,
java.nio.channels.DatagramChannel handle) |
protected NioSession |
NioDatagramAcceptor.newSession(IoProcessor<NioSession> processor,
java.nio.channels.DatagramChannel handle,
java.net.SocketAddress remoteAddress) |
protected NioSession |
NioSocketConnector.newSession(IoProcessor<NioSession> processor,
java.nio.channels.SocketChannel handle)
Create a new
IoSession from a connected socket client handle. |
| Modifier and Type | Method and Description |
|---|---|
protected java.util.Iterator<NioSession> |
NioProcessor.allSessions() |
IoProcessor<NioSession> |
NioSession.getProcessor() |
protected java.util.Iterator<NioSession> |
NioProcessor.selectedSessions() |
| Modifier and Type | Method and Description |
|---|---|
void |
NioDatagramAcceptor.add(NioSession session)
Adds the specified
session to the I/O processor so that
the I/O processor starts to perform any I/O operations related
with the session. |
protected void |
NioProcessor.destroy(NioSession session) |
void |
NioDatagramAcceptor.flush(NioSession session)
Flushes the internal write request queue of the specified
session. |
private boolean |
NioDatagramAcceptor.flush(NioSession session,
long currentTime) |
protected SessionState |
NioProcessor.getState(NioSession session)
Get the state of a session (preparing, open, closed)
|
protected void |
NioProcessor.init(NioSession session) |
protected boolean |
NioProcessor.isInterestedInRead(NioSession session) |
protected boolean |
NioProcessor.isInterestedInWrite(NioSession session) |
protected boolean |
NioProcessor.isReadable(NioSession session) |
protected boolean |
NioProcessor.isWritable(NioSession session) |
protected int |
NioProcessor.read(NioSession session,
IoBuffer buf) |
void |
NioDatagramAcceptor.remove(NioSession session)
Removes and closes the specified
session from the I/O
processor so that the I/O processor closes the connection
associated with the session and releases any other related
resources. |
private boolean |
NioDatagramAcceptor.scheduleFlush(NioSession session) |
protected int |
NioDatagramAcceptor.send(NioSession session,
IoBuffer buffer,
java.net.SocketAddress remoteAddress) |
protected void |
NioProcessor.setInterestedInRead(NioSession session,
boolean isInterested)
register a session for reading
|
protected void |
NioDatagramAcceptor.setInterestedInWrite(NioSession session,
boolean isInterested) |
protected void |
NioProcessor.setInterestedInWrite(NioSession session,
boolean isInterested)
register a session for writing
|
protected int |
NioProcessor.transferFile(NioSession session,
FileRegion region,
int length) |
void |
NioDatagramAcceptor.updateTrafficControl(NioSession session)
Controls the traffic of the specified
session depending of the
IoSession.isReadSuspended() and IoSession.isWriteSuspended()
flags |
protected int |
NioProcessor.write(NioSession session,
IoBuffer buf,
int length) |
void |
NioDatagramAcceptor.write(NioSession session,
WriteRequest writeRequest)
Writes the WriteRequest for the specified
session. |
| Modifier and Type | Method and Description |
|---|---|
protected NioSession |
NioSocketAcceptor.accept(IoProcessor<NioSession> processor,
java.nio.channels.ServerSocketChannel handle)
Accept a client connection for a server socket and return a new
IoSession
associated with the given IoProcessor |
protected NioSession |
NioDatagramConnector.newSession(IoProcessor<NioSession> processor,
java.nio.channels.DatagramChannel handle) |
protected NioSession |
NioDatagramAcceptor.newSession(IoProcessor<NioSession> processor,
java.nio.channels.DatagramChannel handle,
java.net.SocketAddress remoteAddress) |
protected NioSession |
NioSocketConnector.newSession(IoProcessor<NioSession> processor,
java.nio.channels.SocketChannel handle)
Create a new
IoSession from a connected socket client handle. |
| Constructor and Description |
|---|
NioDatagramConnector(java.lang.Class<? extends IoProcessor<NioSession>> processorClass)
Constructor for
NioDatagramConnector with default configuration with default configuration which will use a built-in
thread pool executor to manage the default number of processor instances. |
NioDatagramConnector(java.lang.Class<? extends IoProcessor<NioSession>> processorClass,
int processorCount)
Constructor for
NioDatagramConnector with default configuration which will use a built-in
thread pool executor to manage the given number of processor instances. |
NioDatagramConnector(IoProcessor<NioSession> processor)
Creates a new instance.
|
NioDatagramSession(IoService service,
java.nio.channels.DatagramChannel channel,
IoProcessor<NioSession> processor)
Creates a new connector-side session instance.
|
NioDatagramSession(IoService service,
java.nio.channels.DatagramChannel channel,
IoProcessor<NioSession> processor,
java.net.SocketAddress remoteAddress)
Creates a new acceptor-side session instance.
|
NioSession(IoProcessor<NioSession> processor,
IoService service,
java.nio.channels.Channel channel)
Creates a new instance of NioSession, with its associated IoProcessor.
|
NioSocketAcceptor(java.util.concurrent.Executor executor,
IoProcessor<NioSession> processor)
Constructor for
NioSocketAcceptor with a given Executor for handling
connection events and a given IoProcessor for handling I/O events, useful for
sharing the same processor and executor over multiple IoService of the same type. |
NioSocketAcceptor(IoProcessor<NioSession> processor)
Constructor for
NioSocketAcceptor with default configuration but a
specific IoProcessor, useful for sharing the same processor over multiple
IoService of the same type. |
NioSocketConnector(java.lang.Class<? extends IoProcessor<NioSession>> processorClass)
Constructor for
NioSocketConnector with default configuration with default configuration which will use a built-in
thread pool executor to manage the default number of processor instances. |
NioSocketConnector(java.lang.Class<? extends IoProcessor<NioSession>> processorClass,
int processorCount)
Constructor for
NioSocketConnector with default configuration which will use a built-in
thread pool executor to manage the given number of processor instances. |
NioSocketConnector(java.util.concurrent.Executor executor,
IoProcessor<NioSession> processor)
Constructor for
NioSocketConnector with a given Executor for handling
connection events and a given IoProcessor for handling I/O events, useful for sharing
the same processor and executor over multiple IoService of the same type. |
NioSocketConnector(IoProcessor<NioSession> processor)
Constructor for
NioSocketConnector with default configuration but a
specific IoProcessor, useful for sharing the same processor over multiple
IoService of the same type. |
NioSocketSession(IoService service,
IoProcessor<NioSession> processor,
java.nio.channels.SocketChannel channel)
Creates a new instance of NioSocketSession.
|