I don't see anything wrong, however read my comments inline.

Fastream Technologies wrote:
> void __fastcall ReverseProxyClientClass::WaitForHTTPClientAbort(void)
> {
>  abortingHTTPClient = true;
>  HTTPClient->abortComplete = false;
>  HTTPClient->OnRequestDone = HTTPClientRequestDoneAfterAbort;
>  HTTPClient->Abort();
> 
>  if(!HTTPClient->abortComplete)
>  {
>   bool pausedHere = false;
>   if(!Paused)
>   {
>    Pause();

If you pause THttpCli's underlaying socket it's most likely
not required however I don't think it hurts.

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

It's unfortunately needed to pump messages since THttpCli.Abort
may not block (RequestDone may be triggered delayed by a posted message),
which I think should/can be easily changed to _always behave blocking.
THttpCli.Abort also may call FCtrlSocket.Close.
I don't understand why it doesn't always call FCtrlSocket.Abort,
which would make sure that TWSocket.InternalClose() finished as
soon as possible? 

Arno Garrels

 
>   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