Jelajahi Sumber

deal with collect-tcp

David Rose 23 tahun lalu
induk
melakukan
73cacee551

+ 3 - 0
panda/src/pstatclient/pStatClient.cxx

@@ -451,6 +451,9 @@ client_connect(string hostname, int port) {
       << port << "\n";
     return false;
   }
+  // Make sure we're not queuing up multiple TCP sockets--we expect
+  // immediate writes of our TCP datagrams.
+  _tcp_connection->set_collect_tcp(false);
 
   _reader.add_connection(_tcp_connection);
   _is_connected = true;

+ 4 - 0
pandatool/src/pstatserver/pStatListener.cxx

@@ -50,6 +50,10 @@ connection_opened(const PT(Connection) &,
 
   nout << "Got new connection from " << address << "\n";
 
+  // Make sure this connection doesn't queue up TCP packets we write
+  // to it.
+  new_connection->set_collect_tcp(false);
+
   PStatReader *reader = new PStatReader(_manager, monitor);
   _manager->add_reader(new_connection, reader);
   reader->set_tcp_connection(new_connection);