org.jgroups.blocks
Class ConnectionTable1_4
- Runnable
public class ConnectionTable1_4
implements Runnable
Manages incoming and outgoing TCP connections. For each outgoing message to destination P, if there
is not yet a connection for P, one will be created. Subsequent outgoing messages will use this
connection. For incoming messages, one server socket is created at startup. For each new incoming
client connecting, a new thread from a thread pool is allocated and listens for incoming messages
until the socket is closed by the peer.
Sockets/threads with no activity will be killed
after some time.
Incoming messages from any of the sockets can be received by setting the
message listener.
- Bela Ban
void | run() - Acceptor thread.
|
void | stop() - Closes all open sockets, the server socket and all threads waiting for incoming messages
|
addConnectionListener , getLocalAddress , getReceiveBufferSize , getSendBufferSize , receive , remove , removeConnectionListener , run , send , setReceiveBufferSize , setReceiver , setSendBufferSize , start , stop , toString |
ConnectionTable1_4
public ConnectionTable1_4(int srv_port)
throws Exception
srv_port
-
ConnectionTable1_4
public ConnectionTable1_4(int srv_port,
long reaper_interval,
long conn_expire_time)
throws Exception
srv_port
- reaper_interval
- conn_expire_time
-
ConnectionTable1_4
public ConnectionTable1_4(ConnectionTable.Receiver r,
InetAddress bind_addr,
int srv_port)
throws Exception
r
- bind_addr
- srv_port
-
ConnectionTable1_4
public ConnectionTable1_4(ConnectionTable.Receiver r,
InetAddress bind_addr,
int srv_port,
long reaper_interval,
long conn_expire_time)
throws Exception
r
- bind_addr
- srv_port
- reaper_interval
- conn_expire_time
-
run
public void run()
Acceptor thread. Continuously accept new connections. Create a new
thread for each new connection and put it in conns. When the thread
should stop, it is interrupted by the thread creator.
- run in interface ConnectionTable
stop
public void stop()
Closes all open sockets, the server socket and all threads waiting for incoming messages
- stop in interface ConnectionTable
Copyright B) 2001,2002 www.jgroups.com . All Rights Reserved.