org.jppf.comm.recovery
Class ServerConnection
java.lang.Object
org.jppf.utils.ThreadSynchronization
org.jppf.comm.recovery.AbstractRecoveryConnection
org.jppf.comm.recovery.ServerConnection
- All Implemented Interfaces:
- Runnable
public class ServerConnection
- extends AbstractRecoveryConnection
Instances of this class represent connections to a server from a remote peer.
They are used to send, at regular intervals, a request to the distant peer and check
if the expected response is received. If the response is incorrect or not received at all,
then the connection is considered broken and closed on the server side.
The main goal is to detect network connections broken due to hardware failures on
the remote peer side, which cannot be detected otherwise.
- Author:
- Laurent Cohen
|
Constructor Summary |
ServerConnection(Socket socket,
int maxRetries,
int socketReadTimeout)
Initialize this connection with the specified socket. |
|
Method Summary |
void |
close()
Close this server connection and release the resources it is using. |
void |
run()
|
String |
toString()
|
ServerConnection
public ServerConnection(Socket socket,
int maxRetries,
int socketReadTimeout)
throws Exception
- Initialize this connection with the specified socket.
- Parameters:
socket - the socket connected to a client.maxRetries - the maximum number of failed write/read attempts on a connection before the remote peer is considered dead.socketReadTimeout - the maximum wait time on a response from the remote peer.
- Throws:
Exception - if any error occurs while initializing the socket connection.
run
public void run()
-
close
public void close()
- Close this server connection and release the resources it is using.
- Specified by:
close in class AbstractRecoveryConnection
toString
public String toString()
-
- Overrides:
toString in class Object
Copyright © 2005-2010 JPPF Team.