public class TCPConnectionMap
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
protected class |
TCPConnectionMap.Acceptor |
protected class |
TCPConnectionMap.Mapper |
static interface |
TCPConnectionMap.Receiver
Used for message reception.
|
class |
TCPConnectionMap.TCPConnection |
Modifier and Type | Field and Description |
---|---|
protected java.lang.Thread |
acceptor |
protected java.net.InetAddress |
bind_addr |
protected java.net.InetAddress |
client_bind_addr |
protected int |
client_bind_port |
protected long |
conn_expire_time |
protected boolean |
defer_client_binding |
protected int |
linger |
protected Address |
local_addr |
protected Log |
log |
protected TCPConnectionMap.Mapper |
mapper |
protected int |
peer_addr_read_timeout |
protected int |
recv_buf_size |
protected TCPConnectionMap.Receiver |
recvr |
protected java.util.concurrent.atomic.AtomicBoolean |
running |
protected int |
send_buf_size |
protected int |
send_queue_size |
protected int |
sock_conn_timeout |
protected SocketFactory |
socket_factory |
protected java.net.ServerSocket |
srv_sock |
protected boolean |
tcp_nodelay |
protected TimeService |
time_service |
protected boolean |
use_send_queues |
Constructor and Description |
---|
TCPConnectionMap(java.lang.String service_name,
ThreadFactory f,
SocketFactory socket_factory,
TCPConnectionMap.Receiver r,
java.net.InetAddress bind_addr,
java.net.InetAddress external_addr,
int external_port,
int srv_port,
int max_port) |
TCPConnectionMap(java.lang.String service_name,
ThreadFactory f,
SocketFactory socket_factory,
TCPConnectionMap.Receiver r,
java.net.InetAddress bind_addr,
java.net.InetAddress external_addr,
int external_port,
int srv_port,
int max_port,
long reaper_interval,
long conn_expire_time) |
TCPConnectionMap(java.lang.String service_name,
ThreadFactory f,
TCPConnectionMap.Receiver r,
java.net.InetAddress bind_addr,
java.net.InetAddress external_addr,
int external_port,
int srv_port,
int max_port,
long reaper_interval,
long conn_expire_time) |
protected final TCPConnectionMap.Mapper mapper
protected final java.net.InetAddress bind_addr
protected java.net.InetAddress client_bind_addr
protected int client_bind_port
protected boolean defer_client_binding
protected final Address local_addr
protected final java.net.ServerSocket srv_sock
protected TCPConnectionMap.Receiver recvr
protected final long conn_expire_time
protected Log log
protected int recv_buf_size
protected int send_buf_size
protected int send_queue_size
protected int sock_conn_timeout
protected int peer_addr_read_timeout
protected boolean tcp_nodelay
protected int linger
protected final java.lang.Thread acceptor
protected final java.util.concurrent.atomic.AtomicBoolean running
protected volatile boolean use_send_queues
protected SocketFactory socket_factory
protected TimeService time_service
public TCPConnectionMap(java.lang.String service_name, ThreadFactory f, SocketFactory socket_factory, TCPConnectionMap.Receiver r, java.net.InetAddress bind_addr, java.net.InetAddress external_addr, int external_port, int srv_port, int max_port) throws java.lang.Exception
java.lang.Exception
public TCPConnectionMap(java.lang.String service_name, ThreadFactory f, TCPConnectionMap.Receiver r, java.net.InetAddress bind_addr, java.net.InetAddress external_addr, int external_port, int srv_port, int max_port, long reaper_interval, long conn_expire_time) throws java.lang.Exception
java.lang.Exception
public TCPConnectionMap(java.lang.String service_name, ThreadFactory f, SocketFactory socket_factory, TCPConnectionMap.Receiver r, java.net.InetAddress bind_addr, java.net.InetAddress external_addr, int external_port, int srv_port, int max_port, long reaper_interval, long conn_expire_time) throws java.lang.Exception
java.lang.Exception
public Address getLocalAddress()
public TCPConnectionMap.Receiver getReceiver()
public void setReceiver(TCPConnectionMap.Receiver receiver)
public SocketFactory getSocketFactory()
public void setSocketFactory(SocketFactory factory)
public java.net.InetAddress clientBindAddress()
public TCPConnectionMap clientBindAddress(java.net.InetAddress addr)
public int clientBindPort()
public TCPConnectionMap clientBindPort(int port)
public boolean deferClientBinding()
public TCPConnectionMap deferClientBinding(boolean defer)
public void setReceiveBufferSize(int recv_buf_size)
public void setSocketConnectionTimeout(int timeout)
public TCPConnectionMap peerAddressReadTimeout(int timeout)
public TCPConnectionMap timeService(TimeService ts)
public void setSendBufferSize(int send_buf_size)
public void setLinger(int linger)
public void setTcpNodelay(boolean tcp_nodelay)
public void setSendQueueSize(int send_queue_size)
public void setUseSendQueues(boolean flag)
public int getNumConnections()
public int getNumOpenConnections()
public boolean connectionEstablishedTo(Address addr)
public java.lang.String printConnections()
public void retainAll(java.util.Collection<Address> members)
public int getSenderQueueSize()
public TCPConnectionMap log(Log new_log)
public void addConnectionMapListener(AbstractConnectionMap.ConnectionMapListener<TCPConnectionMap.TCPConnection> l)
public void removeConnectionMapListener(AbstractConnectionMap.ConnectionMapListener<TCPConnectionMap.TCPConnection> l)
public void receive(Address sender, byte[] data, int offset, int length)
public void send(Address dest, byte[] data, int offset, int length) throws java.lang.Exception
java.lang.Exception
public void flush(Address destination) throws java.lang.Exception
java.lang.Exception
public void start() throws java.lang.Exception
java.lang.Exception
public void stop()
public java.lang.String toString()
toString
in class java.lang.Object
protected void setSocketParameters(java.net.Socket client_sock) throws java.net.SocketException
java.net.SocketException
protected static java.lang.String explanation(boolean connection_existed, boolean replace)
Copyright © 1998-2020 Red Hat. All Rights Reserved.