net.i2p.util

## Class SocketTimeout

- java.lang.Object
- - net.i2p.util.SocketTimeout

All Implemented Interfaces:
  SimpleTimer.TimedEvent

    public class SocketTimeout
    extends 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

Constructors
Constructor and Description
`SocketTimeout(long delay)`
`SocketTimeout(Socket socket, long delay)`

### Method Summary

Methods
`void` `cancel()`
`void` `resetTimer()`
`void` `setInactivityTimeout(long timeout)`
`void` `setSocket(Socket s)`
`void` `setTimeoutCommand(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)
`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(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(Socket s)

#### resetTimer

    public void resetTimer()

#### setInactivityTimeout

    public void setInactivityTimeout(long timeout)

#### setTotalTimeoutPeriod

    public void setTotalTimeoutPeriod(long timeoutPeriod)

#### setTimeoutCommand

    public void setTimeoutCommand(Runnable job)

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`