Humm, Markus wrote:
> 
> How would I implement a good message pump in that thread?

For instance (not tested)

procedure TMyThread.Execute;
begin
    prepare the data to be sent
    Wsocket.Create()
    Assign all properties
    ..
    Wsocket.Send(something);
    Wsocket.MessageLoop;
    ..
    clean up, thread result etc. if necessary  
end;

procedure TMyThread.WSocketDataSent(Sender: TObject; ErrCode: Word);
begin
    WSocket.CloseDelayed;
end;

procedure TMyThread.WSocketSessionClosed(Sender: TObject; ErrCode: Word);
begin
    Wsocket.Release;
    PostMessage(WSocket.Handle, WM_QUIT, 0, 0);
end;

Arno Garrels

> It's execute method does just check wheter there is something to send
> and if
> yes, it will build a correct data packet and send it. Then it will be
> idle until the next
> send request comes in.
> 
> Greetings
> 
> Markus
-- 
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