[omniORB] How to shut my Corba Server application in another thread?

Len Holgate (Mail List Account) Mail-lists@dial.pipex.com
Fri, 9 Mar 2001 18:57:07 -0000


I was playing around with something like this today and I found that

void ServerControlImpl::shutdown()
{
    orb->shutdown(0);
}

worked for me, this seems to prevent further method calls and then causes
the server to shut down once all active method calls complete.

The problem you have with

    orb->shutdown(true);

is that the method call that calls shutdown will never complete - because
it's waiting for the shutdown to happen... If you pass 0 then the call to
shutdown will return straight away, your method call will finish and the
server will shutdown when any other outstanding calls finish.

Not sure if this is the correct way of doing it, but it worked for me :)


----- Original Message -----
From: "Victor Chen" <victorcd@163.net>
To: <omniorb-list@uk.research.att.com>
Sent: Friday, March 09, 2001 3:49 AM
Subject: [omniORB] How to shut my Corba Server application in another
thread?


> Dear sirs:
>     I caeate another thread to monitor my data in server,application, How
can I shutdown the application in the thread?
>     I do it like this:
>     poa->deactivate_object(...);
>     pman->deactivate(true,true);
>     orb->shutdown(true);
>     break; // this end the thread create by myself;
> but the application will not exit, and have 2 threads in memory.
> What's the correct method to shutdown my server application?
>     thanks.
>