Arno,
Arno Garrels wrote:
> info2004 wrote:
>> How would I implement a timeout? Do I create a timer component within
>> the thread, or is there a more elegant solution?
>
> A timer is ok since your thread processes messages already :-)
> You could, for example, use an integer that is incremented i
info2004 wrote:
> How would I implement a timeout? Do I create a timer component within
> the thread, or is there a more elegant solution?
A timer is ok since your thread processes messages already :-)
You could, for example, use an integer that is incremented in timer's
event handler and reset i
Thanks every one.
I get the message about custom messages. Excuse the pun.
But one thing puzzles me still.
How would I implement a timeout? Do I create a timer component within the
thread, or is there a more elegant solution?
For example, if there is nothing in the database for me to process,
> Then my understanding from what you have said is that I only get to the
> // check if I need to do something
>
> when a quit is posted.
>
> I am running a finite state machine in the execute loop, which marshalls
> responses, checks timeouts etc. If I don't exit the message loop, I can't
do this.
info2004 wrote:
> Francois, and Arno,
>
>>> while not terminated do
>>> begin
>>> WSocket.MessagePump;
>>> // check if I need to do something
>>> sleep(100);
>>> end;
>>> // close it all down
>>> Or am I missing the point in the use of the message pump?
>>
>> Yes, you miss something. The cod
Francois PIETTE wrote:
>> So in execute is it Ok to:
>>
>> while not terminated do
>> begin
>> WSocket.MessagePump;
>> // check if I need to do something
>> sleep(100);
>> end;
>> // close it all down
>> Or am I missing the point in the use of the message pump?
>>
>
> Yes, you miss someth
Why don't you write your own message pump with GetMessage? This way you can
process your custom messages as well.
Regards,
SZ
On Fri, Jul 18, 2008 at 10:08 AM, info2004 <[EMAIL PROTECTED]> wrote:
> Francois, and Arno,
>
> >> while not terminated do
> >> begin
> >> WSocket.MessagePump;
> >> /
Francois, and Arno,
>> while not terminated do
>> begin
>> WSocket.MessagePump;
>> // check if I need to do something
>> sleep(100);
>> end;
>> // close it all down
>> Or am I missing the point in the use of the message pump?
>
> Yes, you miss something. The code you've done will be very slo
info2004 wrote:
> Arno,
>
> So in execute is it Ok to:
>
> while not terminated do
> begin
> WSocket.MessagePump;
> // check if I need to do something
> sleep(100);
> end;
> // close it all down
>
> Or am I missing the point in the use of the message pump?
This is evil, don't do that, but
> So in execute is it Ok to:
>
> while not terminated do
> begin
> WSocket.MessagePump;
> // check if I need to do something
> sleep(100);
> end;
> // close it all down
> Or am I missing the point in the use of the message pump?
Yes, you miss something. The code you've done will be very slow
Arno,
So in execute is it Ok to:
while not terminated do
begin
WSocket.MessagePump;
// check if I need to do something
sleep(100);
end;
// close it all down
Or am I missing the point in the use of the message pump?
Regards,
Andy
Arno Garrels wrote:
> info2004 wrote:
>> In my thread (
info2004 wrote:
> In my thread (I know, you don't need threads...), in the execute
> procedure, should I call WSocket.ProcessMessages, or
> WSocket.MessagePump?
TWSocket.ProcessMessages processes pending messages once and returns.
You should call TWSocket.MessageLoop instead since it waits for
Hi again,
When I got my grep correct, I found it in WSocket.pas.
Looks like they are the same when multithreaded is true.
...Andy
info2004 wrote:
> Hi,
>
> In my thread (I know, you don't need threads...), in the execute procedure,
> should I call WSocket.ProcessMessages, or WSocket.MessagePum
> In my thread (I know, you don't need threads...), in the execute
> procedure,
> should I call WSocket.ProcessMessages, or WSocket.MessagePump?
>
> Are they the same? If not, what is the difference?
No, they are not the same.
Have a look at the source code and the comments in the source code. Th
Hi,
In my thread (I know, you don't need threads...), in the execute procedure,
should I call WSocket.ProcessMessages, or WSocket.MessagePump?
Are they the same? If not, what is the difference?
Thanks,
Andy
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http:/
15 matches
Mail list logo