T - Message type.public class GridNioServer<T> extends Object
GridNioSession object is
created and can be used in communication.
This implementation supports several selectors and several reading threads.
| Modifier and Type | Class and Description |
|---|---|
static class |
GridNioServer.Builder<T>
Constructs a new instance of
GridNioServer. |
| Modifier and Type | Field and Description |
|---|---|
static int |
DFLT_SEND_QUEUE_LIMIT
Default send queue limit.
|
static int |
DFLT_SES_WRITE_TIMEOUT
Default session write timeout.
|
| Modifier and Type | Method and Description |
|---|---|
static <T> GridNioServer.Builder<T> |
builder()
Creates and returns a builder for a new instance of this class.
|
GridNioFuture<Boolean> |
close(GridNioSession ses) |
GridNioFuture<GridNioSession> |
createSession(SocketChannel ch,
Map<Integer,?> meta)
Establishes a session.
|
long |
idleTimeout()
Gets configurable idle timeout for this session.
|
void |
idleTimeout(long idleTimeout)
Sets configurable idle timeout for session.
|
InetSocketAddress |
localAddress()
Gets the address server is bound to.
|
int |
outboundMessagesQueueSize()
Gets outbound messages queue size.
|
void |
resend(GridNioSession ses) |
GridNioFuture<?> |
sendSystem(GridNioSession ses,
Message msg)
Adds message at the front of the queue without acquiring back pressure semaphore.
|
GridNioFuture<?> |
sendSystem(GridNioSession ses,
Message msg,
IgniteInClosure<? super IgniteInternalFuture<?>> lsnr)
Adds message at the front of the queue without acquiring back pressure semaphore.
|
void |
start()
Starts all associated threads to perform accept and read activities.
|
void |
stop()
Stops all threads and releases all resources.
|
String |
toString() |
long |
writeTimeout()
Gets configurable write timeout for this session.
|
void |
writeTimeout(long writeTimeout)
Sets configurable write timeout for session.
|
public static final int DFLT_SES_WRITE_TIMEOUT
public static final int DFLT_SEND_QUEUE_LIMIT
public static <T> GridNioServer.Builder<T> builder()
public void start()
public void stop()
public InetSocketAddress localAddress()
public GridNioFuture<Boolean> close(GridNioSession ses)
ses - Session to close.public GridNioFuture<?> sendSystem(GridNioSession ses, Message msg)
ses - Session.msg - Message.public GridNioFuture<?> sendSystem(GridNioSession ses, Message msg, @Nullable IgniteInClosure<? super IgniteInternalFuture<?>> lsnr)
ses - Session.msg - Message.lsnr - Future listener notified from the session thread.public void resend(GridNioSession ses)
ses - Session.public GridNioFuture<GridNioSession> createSession(SocketChannel ch, @Nullable Map<Integer,?> meta)
ch - Channel to register within the server and create session for.meta - Optional meta for new session.public long writeTimeout()
DFLT_SES_WRITE_TIMEOUT.public void writeTimeout(long writeTimeout)
writeTimeout - Write timeout in milliseconds.public long idleTimeout()
ConnectorConfiguration.DFLT_IDLE_TIMEOUT.public void idleTimeout(long idleTimeout)
idleTimeout - Idle timeout in milliseconds.public int outboundMessagesQueueSize()
Follow @ApacheIgnite
Ignite Fabric : ver. 1.2.0-incubating Release Date : June 16 2015