Home Help Center

about waitForShutdown

levellevel Member ✭✭
communicator->waitForShutdown();

Are there the same function codes can take place?

Comments

  • marcmarc FloridaAdministrators, ZeroC Staff Marc LaukienOrganization: ZeroC, Inc.Project: The Internet Communications Engine ZeroC Staff
    Sorry, but I do not understand the question.
  • levellevel Member ✭✭
    In corba ,we use


    while(1)
    {
    if(orb-> work_pending())
    orb-> perform_work (500);
    else
    {
    ......run myself code .......
    }
    }

    take place the

    orb->run();

    Because the function "run" runs in block.
    In ice ,How can I repleace the code

    ic->waitForShutdown()
  • marcmarc FloridaAdministrators, ZeroC Staff Marc LaukienOrganization: ZeroC, Inc.Project: The Internet Communications Engine ZeroC Staff
    There is nothing in Ice that is equivalent to CORBA's run() function. You don't need to call anything special, i.e., just activate your object adapters, and you are done. There is no event loop as all the processing is done by separate threads, meaning that you are free to use the main thread in any way you like.

    waitForShutdown() does exactly what the name says: It suspends the caller thread, until somebody calls shutdown(). Other than that, it doesn't do anything, i.e., it is not the entry point to some kind of event loop.
  • levellevel Member ✭✭
    I see
    Thanks a lot .
Sign In or Register to comment.