net.i2p.util
Class SocketTimeout

java.lang.Object
  extended by net.i2p.util.SocketTimeout
All Implemented Interfaces:
SimpleTimer.TimedEvent

public class SocketTimeout
extends java.lang.Object
implements SimpleTimer.TimedEvent

This should be deprecated. It is only used by EepGet, and it uses the inefficient SimpleTimer. The only advantage seems to be a total timeout period, which is the second argument to EepGet.fetch(headerTimeout, totalTimeout, inactivityTimeout), which is most likely always set to -1. Use socket.setsotimeout instead?


Constructor Summary
SocketTimeout(long delay)
           
SocketTimeout(java.net.Socket socket, long delay)
           
 
Method Summary
 void cancel()
           
 void resetTimer()
           
 void setInactivityTimeout(long timeout)
           
 void setSocket(java.net.Socket s)
           
 void setTimeoutCommand(java.lang.Runnable job)
           
 void setTotalTimeoutPeriod(long timeoutPeriod)
           
 void timeReached()
          the time requested has been reached (this call should NOT block, otherwise the whole SimpleTimer gets backed up)
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SocketTimeout

public SocketTimeout(long delay)

SocketTimeout

public SocketTimeout(java.net.Socket socket,
                     long delay)
Method Detail

timeReached

public void timeReached()
Description copied from interface: SimpleTimer.TimedEvent
the time requested has been reached (this call should NOT block, otherwise the whole SimpleTimer gets backed up)

Specified by:
timeReached in interface SimpleTimer.TimedEvent

cancel

public void cancel()

setSocket

public void setSocket(java.net.Socket s)

resetTimer

public void resetTimer()

setInactivityTimeout

public void setInactivityTimeout(long timeout)

setTotalTimeoutPeriod

public void setTotalTimeoutPeriod(long timeoutPeriod)

setTimeoutCommand

public void setTimeoutCommand(java.lang.Runnable job)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object