java.lang.Object
java.util.TimerTask
org.snmp4j.transport.SocketTimeout<A>
- All Implemented Interfaces:
Runnable
The
SocketTimeout
is a TimerTask
that provides means to detect when a socket is not used for
predefined time and then close the socket and free its resources.- Since:
- 3.0
- Author:
- Frank Fock
-
Constructor Summary
ConstructorDescriptionSocketTimeout
(ConnectionOrientedTransportMapping<A> transportMapping, AbstractServerSocket<A> entry) Create a socket timeout handler for the providedTransportMapping
and server socket entry. -
Method Summary
Modifier and TypeMethodDescriptionboolean
cancel()
void
run()
Runs a timeout check and if the socket has timed out, it removes the socket from the associatedTransportMapping
.Methods inherited from class java.util.TimerTask
scheduledExecutionTime
-
Constructor Details
-
SocketTimeout
public SocketTimeout(ConnectionOrientedTransportMapping<A> transportMapping, AbstractServerSocket<A> entry) Create a socket timeout handler for the providedTransportMapping
and server socket entry.- Parameters:
transportMapping
- aConnectionOrientedTransportMapping
that acts as a server.entry
- aAbstractSocketEntry
representing a server socket for a client connection associated with the above transport mapping.
-
-
Method Details