[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/work/icecream-make-it-cool/services
From:       Dirk Mueller <mueller () kde ! org>
Date:       2007-07-26 15:57:51
Message-ID: 1185465471.391561.9261.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 692937 by mueller:

switch monitor connections to bulk transfer


 M  +10 -0     comm.cpp  
 M  +2 -0      comm.h  
 M  +3 -0      scheduler.cpp  


--- branches/work/icecream-make-it-cool/services/comm.cpp #692936:692937
@@ -799,6 +799,16 @@
   return true;
 }
 
+void MsgChannel::setBulkTransfer()
+{
+  if (fd < 0) return;
+
+  int i = 0;
+  setsockopt (fd, IPPROTO_TCP, TCP_NODELAY, (char*) &i, sizeof(i));
+  i = 65536;
+  setsockopt (fd, SOL_SOCKET, SO_SNDBUF, &i, sizeof(i));
+}
+
 /* This waits indefinitely (well, TIMEOUT seconds) for a complete
    message to arrive.  Returns false if there was some error.  */
 bool
--- branches/work/icecream-make-it-cool/services/comm.h #692936:692937
@@ -147,6 +147,8 @@
   std::string name;
   time_t last_talk;
 
+  void setBulkTransfer();
+
   std::string dump() const;
   // NULL  <--> channel closed
   Msg *get_msg(int timeout = 10);
--- branches/work/icecream-make-it-cool/services/scheduler.cpp #692936:692937
@@ -1199,6 +1199,9 @@
     return false;
   // This is really a CS*, but we don't need the full one here
   monitors.push_back (c);
+  // monitors really want to be fed lazily
+  c->setBulkTransfer();
+
   for (list<CS*>::iterator it = css.begin(); it != css.end(); ++it)
     handle_monitor_stats( *it );
 
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic