diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2008-02-08 18:27:28 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2008-02-08 18:27:28 +0000 |
| commit | f38eb15ca9720df6ce917eebfb92035a731acaeb (patch) | |
| tree | 62771670da027057be4db59204bc5822c466e106 /src/DefaultBtInteractive.h | |
| parent | 9ab0ece87f0c1082e075ee4944d849c3af623bd5 (diff) | |
2008-02-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Only add socket to DownloadEngine's select routine when peer or
localhost is unchoked and interested. This lowers CPU usage a
little bit.
* src/PeerInteractionCommand.cc
* src/PeerAbstractCommand.{h, cc}
* src/BtInteractive.h
* src/DefaultBtInteractive.{h, cc}
Diffstat (limited to 'src/DefaultBtInteractive.h')
| -rw-r--r-- | src/DefaultBtInteractive.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/DefaultBtInteractive.h b/src/DefaultBtInteractive.h index 6b4d6670..a70ae31f 100644 --- a/src/DefaultBtInteractive.h +++ b/src/DefaultBtInteractive.h @@ -110,6 +110,8 @@ private: bool _utPexEnabled; bool _dhtEnabled; + size_t _numReceivedMessage; + static const int32_t FLOODING_CHECK_INTERVAL = 5; void addBitfieldMessageToQueue(); @@ -146,12 +148,14 @@ public: virtual void sendPendingMessage(); - void receiveMessages(); + size_t receiveMessages(); virtual int32_t countPendingMessage(); virtual bool isSendingMessageInProgress(); + virtual size_t countReceivedMessageInIteration() const; + void setCuid(int32_t cuid) { this->cuid = cuid; } |
