net.i2p.i2ptunnel.irc

## Class I2PTunnelDCCClient

- java.lang.Object
- - net.i2p.util.EventDispatcherImpl
  - - net.i2p.i2ptunnel.I2PTunnelTask
    - - net.i2p.i2ptunnel.I2PTunnelClientBase
      - - net.i2p.i2ptunnel.irc.I2PTunnelDCCClient

- All Implemented Interfaces:
    Runnable, EventDispatcher

      public class I2PTunnelDCCClient
      extends I2PTunnelClientBase

  A standard client, using an existing socket manager. Targets a single destination and port. Naming resolution is delayed until connect time.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `CONNECT_START_EVENT`
    `static String` | `CONNECT_STOP_EVENT`

    - ### Fields inherited from class net.i2p.i2ptunnel.I2PTunnelClientBase

      `_clientId, _context, _log, _ownDest, dest, l, listenerReady, mySockets, PROP_USE_SSL, sockLock, sockMgr, ss`

    - ### Fields inherited from class net.i2p.i2ptunnel.I2PTunnelTask

      `open, tunnel`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `I2PTunnelDCCClient(String dest, int localPort, int remotePort, Logging l, I2PSocketManager sktMgr, EventDispatcher notifyThis, I2PTunnel tunnel, long clientId)` As of 0.9.20 this is fast, and does NOT connect the manager to the router, or open the local socket.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `clientConnectionRun(Socket s)` Accept one connection only.
    `String` | `getDest()` Returns the destination base32 address for this DCC connection.
    `long` | `getExpires()` Returns the expiration time for this DCC connection.
    `int` | `getRemotePort()` Returns the remote port for this DCC connection.
    `void` | `stop()` Stop listening for new sockets.

    - ### Methods inherited from class net.i2p.i2ptunnel.I2PTunnelClientBase

      `buildSocketManager, buildSocketManager, buildSocketManager, buildSocketManager, close, closeSocket, createI2PSocket, createI2PSocket, createI2PSocket, destroy, getDefaultOptions, getDefaultOptions, getListenHost, getLocalPort, getSocketManager, getSocketManager, getSocketManager, killSharedClient, manageConnection, optionsUpdated, run, startRunning, verifySocketManager`

    - ### Methods inherited from class net.i2p.i2ptunnel.I2PTunnelTask

      `connected, disconnected, errorOccurred, getBooleanOption, getId, getTunnel, isOpen, reportAbuse, routerDisconnected, setId, setName, setTunnel, toString`

    - ### Methods inherited from class net.i2p.util.EventDispatcherImpl

      `attachEventDispatcher, detachEventDispatcher, getEventDispatcher, getEvents, getEventValue, ignoreEvents, notifyEvent, unIgnoreEvents, waitEventValue`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### CONNECT_START_EVENT

          public static final String CONNECT_START_EVENT

      See Also:
        Constant Field Values

    - #### CONNECT_STOP_EVENT

          public static final String CONNECT_STOP_EVENT

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### I2PTunnelDCCClient

          public I2PTunnelDCCClient(String dest,
                                    int localPort,
                                    int remotePort,
                                    Logging l,
                                    I2PSocketManager sktMgr,
                                    EventDispatcher notifyThis,
                                    I2PTunnel tunnel,
                                    long clientId)
                             throws IllegalArgumentException

      As of 0.9.20 this is fast, and does NOT connect the manager to the router, or open the local socket. You MUST call startRunning() for that.
      Parameters:
        `dest` - the target, presumably b32
        `localPort` - if 0, use any port, get actual port selected with getLocalPort()
      Throws:
        `IllegalArgumentException` - if the I2PTunnel does not contain valid config to contact the router

  - ### Method Detail

    - #### clientConnectionRun

          protected void clientConnectionRun(Socket s)

      Accept one connection only.
      Specified by:
        `clientConnectionRun` in class `I2PTunnelClientBase`

    - #### getDest

          public String getDest()

      Returns the destination base32 address for this DCC connection.
      Returns:
        the destination Base32 address

    - #### getExpires

          public long getExpires()

      Returns the expiration time for this DCC connection.
      Returns:
        the expiration time in milliseconds since epoch

    - #### getRemotePort

          public int getRemotePort()

      Returns the remote port for this DCC connection.
      Returns:
        the remote port number

    - #### stop

          public void stop()

      Stop listening for new sockets. We can't call super.close() as it kills all sockets in the sockMgr