bool Sync() { bool bDisconnect = PerformCall( m_objID, this, m_bClient, m_pContext->GetNetContext(), m_pChannel); if (bDisconnect && pDisconnectOnError && pDisconnectOnError->GetIVal() == 0) bDisconnect = false; return !bDisconnect; }
int OverlappedCall::ProcessRequests() { HARDASSERT(::GetCurrentThreadId() == m_dwThreadId); DWORD dwRet; // Wait until either there is work to do - a terminate exception could be delivered in an APC, // so the wait is interruptable. while ((dwRet = WaitForRequest()) == WAIT_OBJECT_0) { #if TRACING == 1 { TRACELOCK(); TRACESTREAM << std::hex << GetCurrentThreadId() << L": Calling " << *m_pMethod << "; " << *this << std::endl; } #endif PerformCall(); #if TRACING == 1 { TRACELOCK(); TRACESTREAM << std::hex << GetCurrentThreadId() << L": Resting; " << m_dwThreadId << std::endl; } #endif } #if TRACING == 1 { TRACELOCK(); TRACESTREAM << std::hex << GetCurrentThreadId() << L": Exiting (" << dwRet << L"); " << m_dwThreadId << std::endl; } #endif // Allow it to terminate return dwRet; }