File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -411,6 +411,29 @@ namespace microLB
411411 [&nodes = n, idx] () {
412412 nodes.close_session (idx);
413413 });
414+
415+ // get the actual TCP connections
416+ auto conn_in = dynamic_cast <net::tcp::Stream*>(incoming->bottom_transport ())->tcp ();
417+ assert (conn_in != nullptr );
418+ auto conn_out = dynamic_cast <net::tcp::Stream*>(outgoing->bottom_transport ())->tcp ();
419+ assert (conn_out != nullptr );
420+
421+ static const uint32_t sendq_max = 0x400000 ;
422+ // set recv window handlers
423+ conn_in->set_recv_wnd_getter (
424+ [conn_out] () -> uint32_t {
425+ auto sendq_size = conn_out->sendq_size ();
426+ if (sendq_size == 0 )
427+ printf (" WARNING: Incoming reports sendq size: %u\n " , sendq_size);
428+ return sendq_max - sendq_size;
429+ });
430+ conn_out->set_recv_wnd_getter (
431+ [conn_in] () -> uint32_t {
432+ auto sendq_size = conn_in->sendq_size ();
433+ if (sendq_size == 0 )
434+ printf (" WARNING: Outgoing reports sendq size: %u\n " , sendq_size);
435+ return sendq_max - sendq_size;
436+ });
414437 }
415438 bool Session::is_alive () const {
416439 return incoming != nullptr ;
You can’t perform that action at this time.
0 commit comments