forked from I2P_Developers/i2p.i2p
i2psnark:
- Remove static instances of I2PSnarkUtil, ConnectionAcceptor, and PeerCoordinatorSet - Convert static classes in Snark to listeners - Fix Snark to work in single torrent mode again - Should now work with multiple single Snarks
This commit is contained in:
@ -173,7 +173,7 @@ public class Peer implements Comparable
|
||||
* If the given BitField is non-null it is send to the peer as first
|
||||
* message.
|
||||
*/
|
||||
public void runConnection(PeerListener listener, BitField bitfield)
|
||||
public void runConnection(I2PSnarkUtil util, PeerListener listener, BitField bitfield)
|
||||
{
|
||||
if (state != null)
|
||||
throw new IllegalStateException("Peer already started");
|
||||
@ -184,7 +184,7 @@ public class Peer implements Comparable
|
||||
// Do we need to handshake?
|
||||
if (din == null)
|
||||
{
|
||||
sock = I2PSnarkUtil.instance().connect(peerID);
|
||||
sock = util.connect(peerID);
|
||||
_log.debug("Connected to " + peerID + ": " + sock);
|
||||
if ((sock == null) || (sock.isClosed())) {
|
||||
throw new IOException("Unable to reach " + peerID);
|
||||
|
Reference in New Issue
Block a user