version 1.16, 2004/04/12 19:52:29
|
version 1.17, 2004/04/26 12:16:43
|
|
|
{ | { |
CIMListenerService *svc = reinterpret_cast<CIMListenerService *>(param); | CIMListenerService *svc = reinterpret_cast<CIMListenerService *>(param); |
| |
svc->init(); |
// svc->init(); bug 1394 |
while(!svc->terminated()) | while(!svc->terminated()) |
{ | { |
svc->runForever(); | svc->runForever(); |
|
|
// spawn a thread to do this | // spawn a thread to do this |
if(_thread_pool==NULL) | if(_thread_pool==NULL) |
{ | { |
_thread_pool = new ThreadPool(0, "Listener", 0, 1, |
|
create_time, destroy_time, deadlock_time); |
|
|
|
CIMListenerService* svc = new CIMListenerService(_portNumber,_sslContext); | CIMListenerService* svc = new CIMListenerService(_portNumber,_sslContext); |
|
try |
|
{ |
|
// Try to initialize the service (bug 1394) |
svc->setIndicationDispatcher(_dispatcher); | svc->setIndicationDispatcher(_dispatcher); |
|
svc->init(); |
|
} |
|
catch(...) |
|
{ |
|
// Error. Exit without creating the ThreadPool, so that this listener |
|
// is not 'alive' |
|
delete svc; |
|
throw; |
|
} |
|
|
|
_thread_pool = new ThreadPool(0, "Listener", 0, 1, |
|
create_time, destroy_time, deadlock_time); |
| |
_thread_pool->allocate_and_awaken(svc,CIMListenerService::_listener_routine); | _thread_pool->allocate_and_awaken(svc,CIMListenerService::_listener_routine); |
| |