Process as many messages as possible in recv buffer

This commit is contained in:
Tatsuhiro Tsujikawa 2012-06-25 21:37:55 +09:00
parent e816c5eee4
commit 3620d271af
2 changed files with 2 additions and 2 deletions

View File

@ -83,7 +83,7 @@ bool DHTInteractionCommand::execute()
taskQueue_->executeTask();
for(size_t i = 0; i < 20; ++i) {
while(1) {
SharedHandle<DHTMessage> m = receiver_->receiveMessage();
if(!m) {
break;

View File

@ -274,7 +274,7 @@ void DefaultBtInteractive::sendKeepAlive() {
size_t DefaultBtInteractive::receiveMessages() {
size_t countOldOutstandingRequest = dispatcher_->countOutstandingRequest();
size_t msgcount = 0;
for(int i = 0; i < UB_MAX_OUTSTANDING_REQUEST+50; ++i) {
while(1) {
if(requestGroupMan_->doesOverallDownloadSpeedExceed() ||
downloadContext_->getOwnerRequestGroup()->doesDownloadSpeedExceed()) {
break;