version 1.10, 2002/05/21 17:20:26
|
version 1.11, 2002/05/22 05:25:30
|
|
|
| |
Monitor::~Monitor() | Monitor::~Monitor() |
{ | { |
printf("deregistering with module controller\n"); |
Tracer::trace(TRC_HTTP, Tracer::LEVEL4, |
|
"deregistering with module controller"); |
| |
if(_module_handle != NULL) | if(_module_handle != NULL) |
{ | { |
|
|
_controller = 0; | _controller = 0; |
delete _module_handle; | delete _module_handle; |
} | } |
printf("deleting rep\n"); |
Tracer::trace(TRC_HTTP, Tracer::LEVEL4, "deleting rep"); |
| |
delete _rep; | delete _rep; |
printf("uninitializing interface \n"); |
Tracer::trace(TRC_HTTP, Tracer::LEVEL4, "uninitializing interface"); |
Socket::uninitializeInterface(); | Socket::uninitializeInterface(); |
printf("returning from monitor destructor\n"); |
Tracer::trace(TRC_HTTP, Tracer::LEVEL4, |
|
"returning from monitor destructor"); |
} | } |
| |
| |
|
|
Message* message= new CloseConnectionMessage(static_cast<HTTPConnection *>(q)->getSocket()); | Message* message= new CloseConnectionMessage(static_cast<HTTPConnection *>(q)->getSocket()); |
message->dest = o.getQueueId(); | message->dest = o.getQueueId(); |
o.enqueue(message); | o.enqueue(message); |
i = 0; |
i--; |
n = _entries.size(); | n = _entries.size(); |
continue; | continue; |
} | } |
|
|
| |
if(_entries[i]._type == Monitor::CONNECTION) | if(_entries[i]._type == Monitor::CONNECTION) |
{ | { |
|
static_cast<HTTPConnection *>(queue)->refcount++; |
if( false == static_cast<HTTPConnection *>(queue)->is_dying()) | if( false == static_cast<HTTPConnection *>(queue)->is_dying()) |
_controller->async_thread_exec(*_module_handle, _dispatch, (void *)queue); | _controller->async_thread_exec(*_module_handle, _dispatch, (void *)queue); |
|
else |
|
static_cast<HTTPConnection *>(queue)->refcount--; |
} | } |
else | else |
{ | { |
|
|
FD_SET(socket, &_rep->ex_fd_set); | FD_SET(socket, &_rep->ex_fd_set); |
| |
// Add the entry to the list: | // Add the entry to the list: |
|
|
_MonitorEntry entry(socket, queueId, type); | _MonitorEntry entry(socket, queueId, type); |
entry.dying = 0; |
|
|
|
_entries.append(entry); | _entries.append(entry); |
| |
// Success! | // Success! |
|
// ATTN-RK-P2-20020521: Why do we need this? |
ModuleController* controlService = | ModuleController* controlService = |
new ModuleController(PEGASUS_QUEUENAME_CONTROLSERVICE); | new ModuleController(PEGASUS_QUEUENAME_CONTROLSERVICE); |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
|
|
FD_CLR(socket, &_rep->wr_fd_set); | FD_CLR(socket, &_rep->wr_fd_set); |
FD_CLR(socket, &_rep->ex_fd_set); | FD_CLR(socket, &_rep->ex_fd_set); |
_entries.remove(i); | _entries.remove(i); |
|
// ATTN-RK-P3-20020521: Need "Socket::close(socket);" here? |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
return true; | return true; |
} | } |
|
|
{ | { |
HTTPConnection *dst = reinterpret_cast<HTTPConnection *>(parm); | HTTPConnection *dst = reinterpret_cast<HTTPConnection *>(parm); |
if( true == dst->is_dying()) | if( true == dst->is_dying()) |
|
{ |
|
dst->refcount--; |
return 0; | return 0; |
|
} |
dst->lock_connection(); | dst->lock_connection(); |
if( false == dst->is_dying()) | if( false == dst->is_dying()) |
dst->run(1); | dst->run(1); |
|
dst->refcount--; |
dst->unlock_connection(); | dst->unlock_connection(); |
| |
return 0; | return 0; |