From: Paul F. <pau...@li...> - 2008-09-12 20:20:33
|
Quick follow up - it looks like Stefan's problem was an address conflict, with an "old" process lurking in the background and holding on to a socket. This happens to people fairly often. Some suggestions: + Check the value returned by [Buffered]Port.open(). If it is false, the port didn't open successfully. Since it is easy to miss an "address conflict" warning in a pile of other messages, consider terminating the program if this happens. That way, it'll be very obvious that there's a problem. (I should update yarp write/rpc/read to do this...) + There's a page on our wiki on diagnosing and recovering from this problem: http://eris.liralab.it/wiki/Conflicts Cheers, Paul Paul Fitzpatrick wrote: > Stefán Freyr Stefánsson wrote: > >> ... >> >> But every so often I end up hanging in the "yarp connect" part! This seems to >> happen more often when there's some extra load on my computer (for example I >> managed to "reproduce" the problem a few times by starting a movie, but this >> is one of those annoying "it doesn't happen every time" problems). >> >> So basically, I end up seeing the "both ports are ready, connecting..." line >> but then everything stops and I never see the "ports connected" line. >> >> Has anybody had this problem? Does anyone have a concrete way of making sure >> that the ports do get connected within scripts? >> >> > > Hi Stefan, > > I'd be interested to hear if anyone else has this problem. > > As a stopgap measure, you could use the "timeout" program, and do > something like: > timeout 5 yarp connect $1 $2 $PROTOCOL > This would wait a maximum of 5 seconds for connection to occur. > > If you have the CVS version of YARP, you can do: > while ! yarp exists $1 $2; do > timeout 5 yarp connect $1 $2 $PROTOCOL > if yarp exists $1 $2; then > echo "ports connected" > else > echo "ports failed to connect" > fi > done > > The two-argument "yarp exists" command checks for a connection between > the named ports. This command hasn't made it into a formal release yet > (it got added during the RobotCub summer school in July). > > With the last formal release, you can grep through the output of a "yarp > ping" to see if a connection has been made. > > If you want to help figure out what the problem is, try running the > connect as follows (assuming Linux): > YARP_VERBOSE=1 yarp connect $1 $2 $PROTOCOL > or > YARP_VERBOSE=1 timeout 5 yarp connect $1 $2 $PROTOCOL > > and send me the output upon failure. > > Cheers, > Paul > > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Robotcub-hackers mailing list > Rob...@li... > https://lists.sourceforge.net/lists/listinfo/robotcub-hackers > |