yarp icon indicating copy to clipboard operation
yarp copied to clipboard

Add timeout parameter to yarp detect and yarp where

Open Nicogene opened this issue 3 years ago • 4 comments
trafficstars

Is your feature request related to a problem? Please describe. When you do yarp detect or yarp where and in your .conf file you have an unreachable IP, it get stuck forever, because it is not possible to set timeout argument to the Contact and the default timeout is -1:

https://github.com/robotology/yarp/blob/ce6f008c86ba58a652b04b6bffdc2b46e9b157e2/src/libYARP_os/src/yarp/os/Contact.cpp#L60

This problem can be reproduced as:

yarp conf 1.2.3.4 10000

And then it get stuck like this:

Looking for name server on 1.2.3.4, port number 10000
If there is a long delay, try:
  yarp conf --clean

This is particular annoying if you use this commands in scripts because you have to stop everything, run yarp conf --clean and then restart the scripts again.

Describe the solution you'd like Add a timeout argument for the two companion commands

Nicogene avatar Jan 11 '22 09:01 Nicogene

If you agree on this solution I can open the PR by myself

Nicogene avatar Jan 11 '22 09:01 Nicogene

I tried your test case with ip 1.2.3.4, but i cannot reproduce it. Both yarp detect and where exit correctly with a messagr after few seconds. Maybe there is something more that I dont know?

randaz81 avatar Apr 12 '22 12:04 randaz81

I wonder if you were using some virtualized environment or WSL or something else which may block the multicast packets sent to find if a server is running on the network. (just an hypothesis, because I cannot reproduce your issue)

randaz81 avatar Apr 21 '22 08:04 randaz81

I tried your test case with ip 1.2.3.4, but i cannot reproduce it. Both yarp detect and where exit correctly with a messagr after few seconds. Maybe there is something more that I dont know?

Sorry for the late reply! If I remember correctly this issue was on the laptop of the robot (then a Ubuntu 20.04) but I can double-check

Nicogene avatar Apr 21 '22 09:04 Nicogene