version 1.103.10.22, 2006/07/21 18:17:51
|
version 1.103.10.23, 2006/07/25 17:51:46
|
|
|
#endif | #endif |
events = select(0, &fdread, NULL, NULL, &tv); | events = select(0, &fdread, NULL, NULL, &tv); |
#ifdef PEGASUS_LOCALDOMAINSOCKET_DEBUG | #ifdef PEGASUS_LOCALDOMAINSOCKET_DEBUG |
|
{ |
AutoMutex automut(Monitor::_cout_mut); | AutoMutex automut(Monitor::_cout_mut); |
cout << "Monitor::run after the select in TIMEOUT clause events = " << events << endl; | cout << "Monitor::run after the select in TIMEOUT clause events = " << events << endl; |
|
} |
#endif | #endif |
| |
| |
|
|
if (GetLastError() == 6) //WW this may be too specific | if (GetLastError() == 6) //WW this may be too specific |
{ | { |
#ifdef PEGASUS_LOCALDOMAINSOCKET_DEBUG | #ifdef PEGASUS_LOCALDOMAINSOCKET_DEBUG |
|
{ |
AutoMutex automut(Monitor::_cout_mut); | AutoMutex automut(Monitor::_cout_mut); |
cout << "Monitor::run about to call 'select since waitForMultipleObjects failed\n"; | cout << "Monitor::run about to call 'select since waitForMultipleObjects failed\n"; |
|
} |
#endif | #endif |
/********* NOTE | /********* NOTE |
this time (tv) combined with the waitForMulitpleObjects timeout is | this time (tv) combined with the waitForMulitpleObjects timeout is |
|
|
else | else |
{ | { |
#ifdef PEGASUS_LOCALDOMAINSOCKET_DEBUG | #ifdef PEGASUS_LOCALDOMAINSOCKET_DEBUG |
|
{ |
AutoMutex automut(Monitor::_cout_mut); | AutoMutex automut(Monitor::_cout_mut); |
cout << "Wait Failed returned\n"; | cout << "Wait Failed returned\n"; |
cout << "failed with " << GetLastError() << "." << endl; | cout << "failed with " << GetLastError() << "." << endl; |
|
} |
#endif | #endif |
pEvents = -1; | pEvents = -1; |
return false; | return false; |
|
|
{ | { |
this->setState(indexPipeCountAssociator[pCount], _MonitorEntry::IDLE); | this->setState(indexPipeCountAssociator[pCount], _MonitorEntry::IDLE); |
#ifdef PEGASUS_LOCALDOMAINSOCKET_DEBUG | #ifdef PEGASUS_LOCALDOMAINSOCKET_DEBUG |
|
{ |
AutoMutex automut(Monitor::_cout_mut); | AutoMutex automut(Monitor::_cout_mut); |
|
|
cout << "setting state of index " << indexPipeCountAssociator[pCount] << " to IDLE" << endl; | cout << "setting state of index " << indexPipeCountAssociator[pCount] << " to IDLE" << endl; |
|
} |
#endif | #endif |
} | } |
| |
|
|
catch (Exception e) | catch (Exception e) |
{ | { |
#ifdef PEGASUS_LOCALDOMAINSOCKET_DEBUG | #ifdef PEGASUS_LOCALDOMAINSOCKET_DEBUG |
|
{ |
AutoMutex automut(Monitor::_cout_mut); | AutoMutex automut(Monitor::_cout_mut); |
cout << " this is what lookup gives - " << e.getMessage() << endl; | cout << " this is what lookup gives - " << e.getMessage() << endl; |
|
} |
#endif | #endif |
exit(1); | exit(1); |
} | } |
catch(...) | catch(...) |
{ | { |
#ifdef PEGASUS_LOCALDOMAINSOCKET_DEBUG | #ifdef PEGASUS_LOCALDOMAINSOCKET_DEBUG |
|
{ |
AutoMutex automut(Monitor::_cout_mut); | AutoMutex automut(Monitor::_cout_mut); |
cout << "MessageQueue::lookup gives strange exception " << endl; | cout << "MessageQueue::lookup gives strange exception " << endl; |
|
} |
#endif | #endif |
exit(1); | exit(1); |
} | } |
|
|
| |
#ifdef PEGASUS_LOCALDOMAINSOCKET_DEBUG | #ifdef PEGASUS_LOCALDOMAINSOCKET_DEBUG |
{ | { |
cout << "In Monitor::run Monitor::CONNECTION clause" << endl; |
|
AutoMutex automut(Monitor::_cout_mut); | AutoMutex automut(Monitor::_cout_mut); |
|
cout << "In Monitor::run Monitor::CONNECTION clause" << endl; |
} | } |
#endif | #endif |
| |
|
|
// read the data | // read the data |
// and set ourself back to IDLE | // and set ourself back to IDLE |
#ifdef PEGASUS_LOCALDOMAINSOCKET_DEBUG | #ifdef PEGASUS_LOCALDOMAINSOCKET_DEBUG |
|
{ |
AutoMutex automut(Monitor::_cout_mut); | AutoMutex automut(Monitor::_cout_mut); |
|
|
cout << endl << " in - entries[indx]._type == Monitor::INTERNAL- " << endl << endl; | cout << endl << " in - entries[indx]._type == Monitor::INTERNAL- " << endl << endl; |
|
} |
#endif | #endif |
if (!entries[indx].isNamedPipeConnection()) | if (!entries[indx].isNamedPipeConnection()) |
{ | { |
|
|
if(!rc) | if(!rc) |
{ | { |
#ifdef PEGASUS_LOCALDOMAINSOCKET_DEBUG | #ifdef PEGASUS_LOCALDOMAINSOCKET_DEBUG |
|
{ |
AutoMutex automut(Monitor::_cout_mut); | AutoMutex automut(Monitor::_cout_mut); |
cout << "ReadFile failed for : " << GetLastError() << "."<< endl; | cout << "ReadFile failed for : " << GetLastError() << "."<< endl; |
|
} |
#endif | #endif |
} | } |
| |
|
|
// We always want the _entries array to 2 bigger than the | // We always want the _entries array to 2 bigger than the |
// current connections requested | // current connections requested |
#ifdef PEGASUS_LOCALDOMAINSOCKET_DEBUG | #ifdef PEGASUS_LOCALDOMAINSOCKET_DEBUG |
|
{ |
AutoMutex automut(Monitor::_cout_mut); | AutoMutex automut(Monitor::_cout_mut); |
PEGASUS_STD(cout) << "In Monitor::solicitPipeMessages at the begining" << PEGASUS_STD(endl); | PEGASUS_STD(cout) << "In Monitor::solicitPipeMessages at the begining" << PEGASUS_STD(endl); |
|
} |
#endif | #endif |
| |
| |
|
|
_entries[index]._type = type; | _entries[index]._type = type; |
_entries[index]._status = _MonitorEntry::IDLE; | _entries[index]._status = _MonitorEntry::IDLE; |
#ifdef PEGASUS_LOCALDOMAINSOCKET_DEBUG | #ifdef PEGASUS_LOCALDOMAINSOCKET_DEBUG |
|
{ |
AutoMutex automut(Monitor::_cout_mut); | AutoMutex automut(Monitor::_cout_mut); |
PEGASUS_STD(cout) << "In Monitor::solicitPipeMessages after seting up _entries[index] index = " << index << PEGASUS_STD(endl); | PEGASUS_STD(cout) << "In Monitor::solicitPipeMessages after seting up _entries[index] index = " << index << PEGASUS_STD(endl); |
|
} |
#endif | #endif |
|
|
return index; | return index; |
} | } |
} | } |