Daemon for monitoring RTDE

Hi!
I’m developing a URCap that saves information about the robot obtained by RTDE in a daemon, my daemon is configured to start by default at boot, the problem is that the RTDE throws me an exception and stop my daemon, I solved this by giving the daemon a sleep time of 20 seg but is there a better way to avoid this??
Maybe someway to know if the robot finish booting so then I start my daemon.

1 Like

Hi,

Just wait for the connexion to be done with such a code (in C here):

        do
    {
            ret=connect(sockfd, (struct sockaddr *)&their_addr,  sizeof(struct sockaddr));
	if (ret==-1) sleep(1);
    } while (ret==-1); 

… a try catch or try except in other programming language, but same way of working.

When the connexion is OK RTDE requests are immediatly all OK also.

Bye.

Thanks this works to avoid the exception at some point but when it came out of the while loop and starts receiving information and the robot still booting there another exception happens, I solved it by putting in try, except all the connection request but I have another question do it consumes a lot resources by doing this??
I’m working my daemon in python btw.