Class NioBaseServer
java.lang.Object
org.jgroups.blocks.cs.BaseServer
org.jgroups.blocks.cs.NioBaseServer
- All Implemented Interfaces:
Closeable, AutoCloseable, ConnectionListener
Base class for NIO clients / servers
- Since:
- 3.6.5
- Author:
- Bela Ban
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class BaseServer
BaseServer.Reaper -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Threadprotected booleanprotected intprotected intprotected longprotected final Lockprotected booleanprotected Selectorprotected booleanFields inherited from class BaseServer
client_bind_addr, client_bind_port, conn_expire_time, conn_listeners, conns, defer_client_binding, factory, linger, local_addr, locks, log, log_details, max_length, reaper, reaperInterval, receiver, recv_buf_size, running, send_buf_size, sock_conn_timeout, socket_factory, tcp_nodelay, time_service, timer, use_peer_connections -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedNioBaseServer(ThreadFactory f, SocketFactory sf, int recv_buf_size) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbooleanbooleancopyOnPartialWrite(boolean b) protected NioConnectioncreateConnection(Address dest) Creates a new connection object to target dest, but doesn't yet connect itprotected voidhandleAccept(SelectionKey key) intmaxSendBuffers(int num) intnumDrops()intintPrints send and receive buffers for all connectionslongreaderIdleTime(long t) protected SelectionKeyregister(SelectableChannel ch, int interest_ops, NioConnection conn) booleanbooleanuseDirectMemory(boolean b) Methods inherited from class BaseServer
addConnectionListener, clearConnections, clearConnections, clientBindAddress, clientBindAddress, clientBindPort, clientBindPort, close, closeConnection, closeConnection, closeConnection, closeConnection, connected, connectionClosed, connectionEstablished, connectionEstablishedTo, connExpireTime, connExpireTimeout, deferClientBinding, deferClientBinding, explanation, flush, flushAll, forAllConnections, getConnection, getLock, getMaxLength, getNumConnections, getNumOpenConnections, handleIncomingConnection, handleOutgoingConnection, hasConnection, linger, linger, localAddress, localAddress, log, log, logDetails, logDetails, notifyConnectionClosed, notifyConnectionEstablished, printConnections, reaperInterval, reaperInterval, receive, receive, receive, receiveBufferSize, receiveBufferSize, receiver, receiver, removeConnectionIfPresent, removeConnectionListener, replaceConnection, retainAll, retainAll, running, send, send, sendBufferSize, sendBufferSize, sendToAll, sendToAll, setMaxLength, socketConnectionTimeout, socketConnectionTimeout, socketFactory, socketFactory, start, stop, tcpNodelay, tcpNodelay, timer, timer, timeService, timeService, toString, toString, useAcks, useAcks, usePeerConnections, usePeerConnections, validateArgs
-
Field Details
-
selector
-
acceptor
-
reg_lock
-
registration
protected volatile boolean registration -
max_send_buffers
protected int max_send_buffers -
num_selects
protected int num_selects -
copy_on_partial_write
protected boolean copy_on_partial_write -
reader_idle_time
protected long reader_idle_time -
use_direct_memory
protected boolean use_direct_memory
-
-
Constructor Details
-
NioBaseServer
-
-
Method Details
-
maxSendBuffers
public int maxSendBuffers() -
maxSendBuffers
-
selectorOpen
public boolean selectorOpen() -
acceptorRunning
public boolean acceptorRunning() -
numSelects
public int numSelects() -
copyOnPartialWrite
public boolean copyOnPartialWrite() -
readerIdleTime
public long readerIdleTime() -
readerIdleTime
-
useDirectMemory
public boolean useDirectMemory() -
useDirectMemory
-
copyOnPartialWrite
-
numPartialWrites
public int numPartialWrites() -
numDrops
public int numDrops() -
printBuffers
Prints send and receive buffers for all connections -
register
protected SelectionKey register(SelectableChannel ch, int interest_ops, NioConnection conn) throws Exception - Throws:
Exception
-
createConnection
Description copied from class:BaseServerCreates a new connection object to target dest, but doesn't yet connect it- Specified by:
createConnectionin classBaseServer- Throws:
Exception
-
handleAccept
- Throws:
Exception
-
acceptorDone
protected void acceptorDone()
-