diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2009-03-27 16:12:09 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2009-03-27 16:12:09 +0000 |
| commit | a69f499ccf99642b7782cc2efae504c59cd2d07e (patch) | |
| tree | d33eb7ad979c79e8db0dc027e188a53cf9083517 /src | |
| parent | ce1231280a1fd115271311306db697427842c6b4 (diff) | |
2009-03-28 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Run DefaultBtMessageDispatcher::
checkRequestSlotAndDoNecessaryThing()
in every 1 sec. The timeout of RequestSlot is 60s by default and
it doesn't need to be called every time when
DefaultBtInteractive::doInteractionProcessing() is called.
* src/DefaultBtInteractive.cc
* src/DefaultBtInteractive.h
Diffstat (limited to 'src')
| -rw-r--r-- | src/DefaultBtInteractive.cc | 6 | ||||
| -rw-r--r-- | src/DefaultBtInteractive.h | 1 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/DefaultBtInteractive.cc b/src/DefaultBtInteractive.cc index 1c37c27e..ef91f64b 100644 --- a/src/DefaultBtInteractive.cc +++ b/src/DefaultBtInteractive.cc @@ -438,8 +438,10 @@ void DefaultBtInteractive::doInteractionProcessing() { detectMessageFlooding(); - dispatcher->checkRequestSlotAndDoNecessaryThing(); - + if(_perSecCheckPoint.elapsed(1)) { + _perSecCheckPoint.reset(); + dispatcher->checkRequestSlotAndDoNecessaryThing(); + } checkHave(); sendKeepAlive(); diff --git a/src/DefaultBtInteractive.h b/src/DefaultBtInteractive.h index d364404f..dd3a79bb 100644 --- a/src/DefaultBtInteractive.h +++ b/src/DefaultBtInteractive.h @@ -123,6 +123,7 @@ private: FloodingStat floodingStat; Time inactiveCheckPoint; Time _pexCheckPoint; + Time _perSecCheckPoint; time_t keepAliveInterval; bool _utPexEnabled; bool _dhtEnabled; |
