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
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate AbstractServerSocket<A> private static final LogAdapterprivate ConnectionOrientedTransportMapping<A> -
Constructor Summary
ConstructorsConstructorDescriptionSocketTimeout(ConnectionOrientedTransportMapping<A> transportMapping, AbstractServerSocket<A> entry) Create a socket timeout handler for the providedTransportMappingand server socket entry. -
Method Summary
Modifier and TypeMethodDescriptionbooleancancel()voidrun()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
-
Field Details
-
logger
-
transportMapping
-
entry
-
-
Constructor Details
-
SocketTimeout
public SocketTimeout(ConnectionOrientedTransportMapping<A> transportMapping, AbstractServerSocket<A> entry) Create a socket timeout handler for the providedTransportMappingand server socket entry.- Parameters:
transportMapping- aConnectionOrientedTransportMappingthat acts as a server.entry- aAbstractSocketEntryrepresenting a server socket for a client connection associated with the above transport mapping.
-
-
Method Details