p-tai / RUBTProject

0 stars 0 forks source link

make dat constructor #8

Closed zhangoose closed 10 years ago

zhangoose commented 10 years ago

Including another constructor in the Peer Class.

anthonywong555 commented 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

zhangoose commented 10 years ago

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)