<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Troy,<br>
<br>
I have ran into this same problem many times when working with sockets.  Is there a reason not to turn off the nagel algorithm by default.  Turning off the Nagel algorithm would seem to be the default behavior for small messages.  This would result in more
 network traffic, but this is probably what is desired (i.e. messages arriving as they are sent, instead of buffered).<br>
<br>
-Shaun<br>
<br>
<br>
<div style="font-family: Times New Roman; color: rgb(0, 0, 0); font-size: 16px;">
<hr tabindex="-1">
<div style="direction: ltr;" id="divRpF193384"><font color="#000000" face="Tahoma" size="2"><b>From:</b> ros-users-bounces@code.ros.org [ros-users-bounces@code.ros.org] on behalf of Kim, Yoonsoo [yesarang.kim@gmail.com]<br>
<b>Sent:</b> Wednesday, October 12, 2011 9:46 PM<br>
<b>To:</b> User discussions<br>
<b>Subject:</b> Re: [ros-users] Latency of subscriber callback for large amount of data<br>
</font><br>
</div>
<div></div>
<div>Thanks a lot!
<div>It works!</div>
<div><br>
</div>
<div>- Yoonsoo<br>
<br>
<div class="gmail_quote">2011/10/13 Troy Straszheim <span dir="ltr"><<a href="mailto:straszheim@willowgarage.com" target="_blank">straszheim@willowgarage.com</a>></span><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Thanks for the reproducable bug report... I get the same behavior, so<br>
long as the packets are small enough.. above 10k or so I don't see<br>
this behavior.  This looks like like Nagel's algorithm at work, try<br>
setting TCP_NODELAY on the subscriber, like this:<br>
<br>
#include <ros/transport_hints.h><br>
ros::Subscriber sub = n.subscribe("chatter", 1000, chatterCallback,<br>
<br>
ros::TransportHints().tcpNoDelay());<br>
_______________________________________________<br>
ros-users mailing list<br>
<a href="mailto:ros-users@code.ros.org" target="_blank">ros-users@code.ros.org</a><br>
<a href="https://code.ros.org/mailman/listinfo/ros-users" target="_blank">https://code.ros.org/mailman/listinfo/ros-users</a><br>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>
</body>
</html>