Announcement

Collapse
No announcement yet.

Problem using EvolutionCompleteBoot

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem using EvolutionCompleteBoot

    I have two threads running forever (sending and receiving messages over sockets) in my program. Everything seems to work fine but I can't use the web server since I get the "Reboot in progress" message. In order to explicitly tell the Evolution OS my boot is complete I've added EvolutionCompleteBoot() after my threads have been started. However, I can't seem to get rid of that message anyway. What am I doing wrong?

    My SDKMain:

    int SDKMain(struct command_line *commandLine, struct http_server *server)
    {
    (void)commandLine; //To avoid compiler warning for unused variables
    (void)server; //To avoid compiler warning for unused variables

    TLOG(TLOG_SEVERITY_DEBUG, "INFO: Initializing unit");
    initUnit();
    TLOG(TLOG_SEVERITY_DEBUG, "INFO: Unit initialized ");
    TLOG(TLOG_SEVERITY_DEBUG, "INFO: Start sending SYNCHRONIZATION_MSG");
    RunThread(255, (void (*)(void))sendSynchronizationMessageThread, "sendSynchronizationMessageThread", 18000, (void *)MSECS_BETWEEN_SYNCHRONIZATION_MESSAGES);
    TLOG(TLOG_SEVERITY_DEBUG, "INFO: Start sending LOG_MSG");
    RunThread(255, (void (*)(void))sendLogMessageThread, "sendLogMessageThread", 18000, (void *)MSECS_BETWEEN_LOG_MESSAGES);
    TLOG(TLOG_SEVERITY_DEBUG, "INFO: Main finished");
    EvolutionCompleteBoot();
    return 0;
    }

  • #2
    Reboot in progress

    You are generally doing it correctly. It is important that you spawn both of your threads as you do, rather than loop in SDKMain. The "reboot" finishes after you return from SDKMain, so the call to EvolutionCompleteBoot is not necessary.

    Is it possible that one or more of your threads is hogging some critical resource? You should be able to use the CLI to examine your task states, your sockets status, and other debug information.

    Comment


    • #3
      Yes, you were right. Apparantly I had som socket issues which I wasn't aware of.

      Is there a way of determining if a socket is alive and well? At the moment my quick-fix is to try sending/receiving and then checking the errno for errors. If there are any errors I close the socket and open another one.

      Also, is there a way of getting the local port number from a client socket? My current solution is to keep track of port numbers in a separate structure and whenever I open a socket I use bind() with my own, predetermined port number. It feels kind of dull though...

      Regards,

      Daniel

      Comment

      Working...
      X