class PeerAcceptor extends Object
| Modifier and Type | Class and Description |
|---|---|
static class | PeerAcceptor.ProtocolExceptionA unique exception so we can tell the ConnectionAcceptor about non-BT connections |
| Modifier and Type | Field and Description |
|---|---|
(package private) PeerCoordinatorSet | coordinatorsCoordinators |
| Constructor and Description |
|---|
PeerAcceptor(PeerCoordinator coordinator)Creates a single-torrent PeerAcceptor. |
PeerAcceptor(PeerCoordinatorSet coordinators)Creates a multi-torrent PeerAcceptor. |
| Modifier and Type | Method and Description |
|---|---|
void | connection(I2PSocket socket,
InputStream in,
OutputStream out)Handle an incoming connection from a peer. |
final PeerCoordinatorSet coordinators
public PeerAcceptor(PeerCoordinator coordinator)
coordinator - the coordinatorpublic PeerAcceptor(PeerCoordinatorSet coordinators)
coordinators - the set of coordinators for all active torrentspublic void connection(I2PSocket socket, InputStream in, OutputStream out) throws IOException
socket - the incoming socketin - the input streamout - the output streamIOException - if the connection fails or the infohash is unknown