Closed zhangoose closed 10 years ago
To do this, add a private static class inside of client that extends threads. Inside the class, you want to check to see if a peer send a handshake message. When then send the handshake message, one part of the message will have their peer id, you that want that for making the peer object. See here for more details: http://www.bittorrent.org/beps/bep_0003.html
Added four setters inside Peer instead of making a new constructor for part 1:
public void setPeerConnection(Socket peerConnection) public void setOutgoing(DataOutputStream outgoing) public void setIncoming(DataInputStream incoming)
Including another constructor in the Peer Class.