org.jgroups.blocks
Class TCPConnectionMap
java.lang.Object
org.jgroups.blocks.TCPConnectionMap
public class TCPConnectionMap
- extends java.lang.Object
Constructor Summary |
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)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
mapper
protected final TCPConnectionMap.Mapper mapper
bind_addr
protected final java.net.InetAddress bind_addr
client_bind_addr
protected java.net.InetAddress client_bind_addr
client_bind_port
protected int client_bind_port
defer_client_binding
protected boolean defer_client_binding
local_addr
protected final Address local_addr
srv_sock
protected final java.net.ServerSocket srv_sock
receiver
protected TCPConnectionMap.Receiver receiver
conn_expire_time
protected final long conn_expire_time
log
protected final Log log
recv_buf_size
protected int recv_buf_size
send_buf_size
protected int send_buf_size
send_queue_size
protected int send_queue_size
sock_conn_timeout
protected int sock_conn_timeout
tcp_nodelay
protected boolean tcp_nodelay
linger
protected int linger
acceptor
protected final java.lang.Thread acceptor
running
protected final java.util.concurrent.atomic.AtomicBoolean running
use_send_queues
protected volatile boolean use_send_queues
socket_factory
protected SocketFactory socket_factory
TCPConnectionMap
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
- Throws:
java.lang.Exception
TCPConnectionMap
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
- Throws:
java.lang.Exception
TCPConnectionMap
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
- Throws:
java.lang.Exception
getLocalAddress
public Address getLocalAddress()
getReceiver
public TCPConnectionMap.Receiver getReceiver()
setReceiver
public void setReceiver(TCPConnectionMap.Receiver receiver)
getSocketFactory
public SocketFactory getSocketFactory()
setSocketFactory
public void setSocketFactory(SocketFactory factory)
clientBindAddress
public java.net.InetAddress clientBindAddress()
clientBindAddress
public TCPConnectionMap clientBindAddress(java.net.InetAddress addr)
clientBindPort
public int clientBindPort()
clientBindPort
public TCPConnectionMap clientBindPort(int port)
deferClientBinding
public boolean deferClientBinding()
deferClientBinding
public TCPConnectionMap deferClientBinding(boolean defer)
addConnectionMapListener
public void addConnectionMapListener(AbstractConnectionMap.ConnectionMapListener<TCPConnectionMap.TCPConnection> l)
removeConnectionMapListener
public void removeConnectionMapListener(AbstractConnectionMap.ConnectionMapListener<TCPConnectionMap.TCPConnection> l)
receive
public void receive(Address sender,
byte[] data,
int offset,
int length)
- Calls the receiver callback. We do not serialize access to this method,
and it may be called concurrently by several Connection handler threads.
Therefore the receiver needs to be reentrant.
send
public void send(Address dest,
byte[] data,
int offset,
int length)
throws java.lang.Exception
- Throws:
java.lang.Exception
start
public void start()
throws java.lang.Exception
- Throws:
java.lang.Exception
stop
public void stop()
setSocketParameters
protected void setSocketParameters(java.net.Socket client_sock)
throws java.net.SocketException
- Throws:
java.net.SocketException
setReceiveBufferSize
public void setReceiveBufferSize(int recv_buf_size)
setSocketConnectionTimeout
public void setSocketConnectionTimeout(int sock_conn_timeout)
setSendBufferSize
public void setSendBufferSize(int send_buf_size)
setLinger
public void setLinger(int linger)
setTcpNodelay
public void setTcpNodelay(boolean tcp_nodelay)
setSendQueueSize
public void setSendQueueSize(int send_queue_size)
setUseSendQueues
public void setUseSendQueues(boolean use_send_queues)
getNumConnections
public int getNumConnections()
connectionEstablishedTo
public boolean connectionEstablishedTo(Address addr)
printConnections
public java.lang.String printConnections()
retainAll
public void retainAll(java.util.Collection<Address> members)
getConnectionExpiryTimeout
public long getConnectionExpiryTimeout()
getSenderQueueSize
public int getSenderQueueSize()
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
Copyright © 1998-2012 Bela Ban / Red Hat. All Rights Reserved.