class ConnectionAcceptor extends Object implements Runnable
This class manages the main I2P server socket that listens for incoming peer connections and routes them to the correct PeerAcceptor based on the torrent's info hash. It handles:
The acceptor supports multi-torrent operation by working with a PeerCoordinatorSet to determine which torrent a connection belongs to based on the info hash in the BitTorrent handshake.
Connections that repeatedly fail protocol validation may be temporarily blacklisted to prevent abuse.
| Constructor and Description |
|---|
ConnectionAcceptor(I2PSnarkUtil util,
PeerAcceptor peeracceptor)
Unused (single torrent).
|
ConnectionAcceptor(I2PSnarkUtil util,
PeerCoordinatorSet set)
Multitorrent.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getPort() |
void |
halt()
May be restarted later with startAccepting().
|
void |
restart()
Effectively unused, would only be called if we changed I2CP host/port, which is hidden in the
gui if in router context
|
void |
run() |
void |
startAccepting()
May be called even when already running.
|
public ConnectionAcceptor(I2PSnarkUtil util, PeerAcceptor peeracceptor)
public ConnectionAcceptor(I2PSnarkUtil util, PeerCoordinatorSet set)
public int getPort()
public void halt()
public void restart()
public void startAccepting()