Kaynağa Gözat

2008-06-16 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>

	Added writable test for Socket when the sending message is in 
progress.
	Usually the sending message is piece message. Without wriable 
check,
	upload latency is dropped to more than 1sec.
	* src/PeerInteractionCommand.cc
Tatsuhiro Tsujikawa 17 yıl önce
ebeveyn
işleme
e32eb83c99
2 değiştirilmiş dosya ile 11 ekleme ve 0 silme
  1. 7 0
      ChangeLog
  2. 4 0
      src/PeerInteractionCommand.cc

+ 7 - 0
ChangeLog

@@ -1,3 +1,10 @@
+2008-06-16  Tatsuhiro Tsujikawa  <tujikawa at rednoah dot com>
+
+	Added writable test for Socket when the sending message is in progress.
+	Usually the sending message is piece message. Without wriable check,
+	upload latency is dropped to more than 1sec.
+	* src/PeerInteractionCommand.cc
+
 2008-06-16  Tatsuhiro Tsujikawa  <tujikawa at rednoah dot com>
 
 	Create only requested files and files which shares a piece with

+ 4 - 0
src/PeerInteractionCommand.cc

@@ -222,6 +222,7 @@ bool PeerInteractionCommand::executeInternal() {
     break;
   }
   case WIRED:
+    disableWriteCheckSocket();
     btInteractive->doInteractionProcessing();
     if(btInteractive->countReceivedMessageInIteration() > 0) {
       updateKeepAlive();
@@ -242,6 +243,9 @@ bool PeerInteractionCommand::executeInternal() {
     } else {
       disableReadCheckSocket();
     }
+    if(btInteractive->isSendingMessageInProgress()) {
+      setWriteCheckSocket(socket);
+    }
     break;
   }
   if(btInteractive->countPendingMessage() > 0) {