- java.lang.Object
-
- java.util.TimerTask
-
- org.snmp4j.transport.SocketTimeout<A>
-
- All Implemented Interfaces:
Runnable
public class SocketTimeout<A extends Address> extends TimerTask
TheSocketTimeout
is aTimerTask
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
Constructors Constructor Description SocketTimeout(ConnectionOrientedTransportMapping<A> transportMapping, AbstractServerSocket<A> entry)
Create a socket timeout handler for the providedTransportMapping
and server socket entry.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
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.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from class java.util.TimerTask
scheduledExecutionTime
-
-
-
-
Constructor Detail
-
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.
-
-