Package net.i2p.i2ptunnel.irc
Class I2PTunnelDCCServer
java.lang.Object
net.i2p.util.EventDispatcherImpl
net.i2p.i2ptunnel.I2PTunnelTask
net.i2p.i2ptunnel.I2PTunnelServer
net.i2p.i2ptunnel.irc.I2PTunnelDCCServer
- All Implemented Interfaces:
Runnable,EventDispatcher
public class I2PTunnelDCCServer extends I2PTunnelServer
A standard server that only answers for registered ports,
and each port can only be used once.
direct conn
<---> I2PTunnelDCCServer <--------------->I2PTunnelDCCClient <---->
originating responding
chat client chat client
CHAT ---> I2PTunnelIRCClient --> IRC server --> I2TunnelIRCClient ----->
SEND ---> I2PTunnelIRCClient --> IRC server --> I2TunnelIRCClient ----->
RESUME <--- I2PTunnelIRCClient <-- IRC server <-- I2TunnelIRCClient <-----
ACCEPT ---> I2PTunnelIRCClient --> IRC server --> I2TunnelIRCClient ----->
- Since:
- 0.8.9
-
Field Summary
Fields inherited from class net.i2p.i2ptunnel.I2PTunnelServer
__serverId, _clientExecutor, _log, bidir, i2pss, l, localPort, PROP_ALT_PKF, PROP_UNIQUE_LOCAL, PROP_USE_SSL, readTimeout, remoteHost, remotePort, slock, sockMgr, sslLock, task -
Constructor Summary
Constructors Constructor Description I2PTunnelDCCServer(I2PSocketManager sktMgr, Logging l, EventDispatcher notifyThis, I2PTunnel tunnel)There's no support for unsolicited incoming I2P connections, so there's no server host or port parameters. -
Method Summary
Modifier and Type Method Description intacceptOutgoing(int port)An outgoing ACCEPT responseprotected voidblockingHandle(I2PSocket socket)An incoming DCC connection, only accept for a known port.booleanclose(boolean forced)Note that the tunnel can be reopened after this by calling startRunning().intnewOutgoing(byte[] ip, int port, String type)An outgoing DCC requestintresumeIncoming(int port)An incoming RESUME requestMethods inherited from class net.i2p.i2ptunnel.I2PTunnelServer
destroy, getHandlerCount, getReadTimeout, getSocket, getSocket, optionsUpdated, run, setReadTimeout, shouldUsePool, startRunningMethods inherited from class net.i2p.i2ptunnel.I2PTunnelTask
connected, disconnected, errorOccurred, getId, getTunnel, isOpen, reportAbuse, routerDisconnected, setId, setName, setTunnel, toStringMethods inherited from class net.i2p.util.EventDispatcherImpl
attachEventDispatcher, detachEventDispatcher, getEventDispatcher, getEvents, getEventValue, ignoreEvents, notifyEvent, unIgnoreEvents, waitEventValue
-
Constructor Details
-
I2PTunnelDCCServer
public I2PTunnelDCCServer(I2PSocketManager sktMgr, Logging l, EventDispatcher notifyThis, I2PTunnel tunnel)There's no support for unsolicited incoming I2P connections, so there's no server host or port parameters.- Parameters:
sktMgr- an existing socket manager- Throws:
IllegalArgumentException- if the I2PTunnel does not contain valid config to contact the router
-
-
Method Details
-
blockingHandle
An incoming DCC connection, only accept for a known port. Passed through without filtering.- Overrides:
blockingHandlein classI2PTunnelServer
-
close
public boolean close(boolean forced)Description copied from class:I2PTunnelServerNote that the tunnel can be reopened after this by calling startRunning(). This does not release all resources. In particular, the I2PSocketManager remains and it may have timer threads that continue running. To release all resources permanently, call destroy().- Overrides:
closein classI2PTunnelServer- Returns:
- success
-
newOutgoing
An outgoing DCC request- Parameters:
ip- local irc client IPport- local irc client porttype- ignored- Returns:
- i2p port or -1 on error
-
resumeIncoming
public int resumeIncoming(int port)An incoming RESUME request- Parameters:
port- local dcc server I2P port- Returns:
- local IRC client DCC port or -1 on error
-
acceptOutgoing
public int acceptOutgoing(int port)An outgoing ACCEPT response- Parameters:
port- local irc client DCC port- Returns:
- local DCC server i2p port or -1 on error
-