Pingers | ![]() print-friendly |
by Paul Hammant
Introduction
Although it may not be necessary for all types of transport, there is a mechanism called a pinger that can be used to keep the connection alive. Pingers run on the client side.
Pinger Interface
It is possible to write your own or extend the exiting ones if there are different requirements. The interface for bespoke pingers is 'ConnectionPinger'
public interface ConnectionPinger
{
void setInvocationHandler( ClientInvocationHandler altrmiInvocationHandler );
void start();
void stop();
}
Pinger types
Here are the types of pinger implemented so far
DefaultConnectionPinger
This pinger pings every ten seconds, but stops one hundred seconds after the last real request. The 10 & 100 are configurable of course.
This pinger is the default and will be used if no other is specified.
PerpetualPinger
This pinger pings every ten seconds until the connection is closed.
NeverConnectionPinger
This pinger never pings the server.


