Package org.jgroups.protocols
Class FD_SOCK.ServerSocketHandler
- java.lang.Object
-
- org.jgroups.protocols.FD_SOCK.ServerSocketHandler
-
- All Implemented Interfaces:
java.lang.Runnable
- Enclosing class:
- FD_SOCK
protected class FD_SOCK.ServerSocketHandler extends java.lang.Object implements java.lang.Runnable
Handles the server-side of a client-server socket connection. Waits until a client connects, and then loops until that client closes the connection. Note that there is no new thread spawned for the listening on the client socket, therefore there can only be 1 client connection at the same time. Subsequent clients attempting to create a connection will be blocked until the first client closes its connection. This should not be a problem as the ring nature of the FD_SOCK protocol always has only 1 client connect to its right-hand-side neighbor.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Thread
acceptor
protected java.util.List<FD_SOCK.ClientConnectionHandler>
clients
-
Constructor Summary
Constructors Modifier Constructor Description protected
ServerSocketHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.String
getName()
void
run()
Only accepts 1 client connection at a time (saving threads)protected void
start()
protected void
stop(boolean graceful)
-
-
-
Field Detail
-
acceptor
protected java.lang.Thread acceptor
-
clients
protected final java.util.List<FD_SOCK.ClientConnectionHandler> clients
-
-