org.klomp.snark
Class PeerConnectionOut
java.lang.Object
org.klomp.snark.PeerConnectionOut
- All Implemented Interfaces:
- Runnable
class PeerConnectionOut
- extends Object
- implements Runnable
Field Summary |
(package private) long |
lastSent
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
lastSent
long lastSent
PeerConnectionOut
public PeerConnectionOut(Peer peer,
DataOutputStream dout)
startup
public void startup()
run
public void run()
- Continuesly monitors for more outgoing messages that have to be send.
Stops if quit is true of an IOException occurs.
- Specified by:
run
in interface Runnable
disconnect
public void disconnect()
sendAlive
void sendAlive()
sendChoke
void sendChoke(boolean choke)
sendInterest
void sendInterest(boolean interest)
sendHave
void sendHave(int piece)
sendBitfield
void sendBitfield(BitField bitfield)
retransmitRequests
void retransmitRequests(List requests)
sendRequests
void sendRequests(List requests)
sendRequest
void sendRequest(Request req)
queuedBytes
int queuedBytes()
sendPiece
void sendPiece(int piece,
int begin,
int length,
byte[] bytes)
sendCancel
void sendCancel(Request req)
cancelRequest
void cancelRequest(int piece,
int begin,
int length)