Why do you call WSocket's message pump from within
your own? GetMessage returns FALSE after receiving WM_QUIT.
So you could just post another, custom message. 

Try this instead:  
 
while GetMessage(Msg, 0, 0, 0) do
begin
    if Msg.Message = WM_REQUEST then
    Begin
        ...some code
        http.GetASync;
        ...some code
    end
    else if WM_MY_MESSAGE then
        ...some code after requestdone      
    else begin
        TranslateMessage(Msg);
        DispatchMessage(Msg);
    end;
end;

Frans van Daalen wrote:
> I have the following code
> 
> procedure TConsumerThread.Execute;
> ...some code
>      while GetMessage(Msg, 0, 0, 0) do
>      begin
>         TranslateMessage(Msg);
>         DispatchMessage(Msg);
>         if Msg.Message = WM_REQUEST then
>         Begin
> ...some code
>          http.GetASync;
>          http.CtrlSocket.MessageLoop;
> ...some code
>         end;
>      end;
> 
> 
> in the requestdone I have
> 
>     PostMessage((Sender as THttpCli).CtrlSocket.Handle, WM_QUIT, 0, 0);
> 
> This wm_quit will hoverever also stop the thread execute...how can i solve
> that ?
-- 
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