Hello Arno, Francois and All,

I call,

void __fastcall ReverseProxyClientClass::WaitForHTTPClientAbort(void)
{
 abortingHTTPClient = true;
 HTTPClient->abortComplete = false;
 HTTPClient->OnRequestDone = HTTPClientRequestDoneAfterAbort;
 HTTPClient->Abort();

 if(!HTTPClient->abortComplete)
 {
  bool pausedHere = false;
  if(!Paused)
  {
   Pause();
   pausedHere = true;
  }

  MSG msg;
  while(!HTTPClient->abortComplete)
   if(GetMessage(&msg, NULL, 0, 0))
    affinityThread->processServerThreadMessage(msg);
   else
                         break;

  if(!FSessionClosedFlag && pausedHere)
   Resume();
 }

 abortingHTTPClient = false;
 HTTPClient->working = false;
 HTTPClient->abortNextTime = false;
 HTTPClient->OnRequestDone = NULL;
}
//---------------------------------------------------------------------------
void __fastcall 
ReverseProxyClientClass::HTTPClientRequestDoneAfterAbort(TObject *Sender, 
THttpRequest RqType, WORD ErrCode)
{
 HTTPClient->abortComplete = true;
}
//---------------------------------------------------------------------------

from return-to-pool function in worker/client thread. There are definable 
number of clients per thread. The message pump is as Arno previously 
suggested. This code now works fine for 7-12 hours then crashes. Of course I 
won't bog you with thousands of lines of code but perhaps you could tell me 
if the above sync logic is cool (or not).

Best Regards,

SZ 

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to