-
Notifications
You must be signed in to change notification settings - Fork 166
TCP_NODELAY connection header #292
Comments
Hi @StefanGlaser, I see the definition but I don't see it used anywhere in the code.
Does that mean that |
Hi @jubeira, thanks a lot for your quick response! I have a running setup where I use the option hardcoded in the
I agree that it should be an option that you can specify when creating a Subscriber. However, before I change / extend the implementation accordingly I wanted to ask if there already exists an solution to this problem. I really wonder why nobody ever mentioned this issue. It is one of the most fundamental settings when dealing with "real-time" communication via TCP. On the other hand I know that ROS has some means of telling a Publisher to use |
As you say, adding the the option to the header is a start, but the problem is how the connection requests are handled in the lower layers. Right now this is not implemented AFAIK. If you need this feature and want to propose a patch for it you are more than welcome! I'll be happy to review it. |
The lower connection layers do use this option. I run a test in which I exchange very small messages in a ping-pong scenario between two nodes in 100Hz (and a message buffer of 1). With my change I don't miss any message (running for several minutes). Without the change I do miss a couple of messages every second. So, I guess I'll go ahead and try to properly integrate this option into the rosjava core framework. Thank you very much for your help! |
Then that sounds great! Thanks to you! My only advice is to try to make the usage somewhat similar to how it's done in |
I meanwhile did some in depth analysis of the issue and recognized that rosjava simply ignores the I extended rosjava to set the I then reimplemented the Talker node in Python and tried the same test again. The result was as expected - no TCP message contained multiple ROS messages. Thus, Python is respecting the So I guess I have to dig deeper... :( @jubeira I tried to get a similar usage to |
Alright; interesting conclusion. Thanks for all those details! I have to say I was surprised when you said everything had worked out of the box.
For now a boolean would work as you say. I'd be fine with adding a |
Well, my initial test involved a rosjava node and a c++ node and I unfortunately only measured on the rosjava side. Looking back this was a bit premature, as I didn't really check the transmitted messages on TCP level. But for the final implementation such tests are fundamental... Anyhow, I'll take a second look at how connections are established and try to integrate this option if possible. Of course, I'll only add new overloaded functions and keep the default functionality as it was before to ensure backward compatibility. Thanks again for your interest in this issue and your quick feedback! |
Hi again, |
Sounds great! Thanks @StefanGlaser ! 😃 |
Hi,
I'm using rosjava for controlling a robot in "real-time". In order to get a "real-time" communication, I must use the TCP_NODELAY option for the internal TCP connections, otherwise messages are buffered and not received in time.
There exists a corresponding option in the
ConnectionHeaderFields
. However, I don't see any way to use this option on a Publisher / Subscriber. So currently I hard-coded this option into theTopicDeclaration
and everything works fine. But that's not the way it's supposed to be.What is the correct way to set the TCP_NODELAY option for a Publisher / Subscriber? Is it even possible in the current implementation?
Thanks a lot in advance!
The text was updated successfully, but these errors were encountered: