Re: [twsocket] processmessages or messagepump

2008-07-19 Thread info2004
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 in

Re: [twsocket] processmessages or messagepump

2008-07-18 Thread info2004
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 slow at processing

Re: [twsocket] processmessages or messagepump

2008-07-18 Thread Fastream Technologies
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; // check if I

Re: [twsocket] processmessages or messagepump

2008-07-18 Thread Olivier Sannier
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 something. The code you've

Re: [twsocket] processmessages or messagepump

2008-07-18 Thread Arno Garrels
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 it

Re: [twsocket] processmessages or messagepump

2008-07-17 Thread info2004
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 (I

Re: [twsocket] processmessages or messagepump

2008-07-17 Thread Francois PIETTE
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 at

Re: [twsocket] processmessages or messagepump

2008-07-17 Thread Arno Garrels
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 use

[twsocket] processmessages or messagepump

2008-07-16 Thread info2004
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

Re: [twsocket] processmessages or messagepump

2008-07-16 Thread Francois PIETTE
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. They

Re: [twsocket] processmessages or messagepump

2008-07-16 Thread info2004
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.MessagePump?

Re: [twsocket] processmessages or messagepump

2008-07-16 Thread Arno Garrels
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

[twsocket] ProcessMessages ?

2005-12-20 Thread Michael Preslar
Hey folks.. Im working on a hobby program.. And have run into a problem. Using the example program ConCli1.dpr, I've made some modifications so that it can act as a something of a chat server. My source is available here: http://www.mpcode.com/door.zip The problem Im running into it in the

Re: [twsocket] ProcessMessages ?

2005-12-20 Thread Francois PIETTE
://www.overbyte.be - Original Message - From: Michael Preslar [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Tuesday, December 20, 2005 5:07 PM Subject: [twsocket] ProcessMessages ? Hey folks.. Im working on a hobby program.. And have run into a problem. Using

Re: [twsocket] ProcessMessages ?

2005-12-20 Thread Michael Preslar
(Warning: Old School chatter among us :) ) What I'm wanting to do is write a bbs door game with a tcp client built in.. Local input (from the door) gets sent across tcp to the server, which is then relayed to all other nodes. Basically, real time interbbs. I'm the developer of Legend of the

Re: [twsocket] ProcessMessages

2005-05-03 Thread Francois Piette
? Study the IcsDll1 sample program ! -- [EMAIL PROTECTED] http://www.overbyte.be - Original Message - From: [EMAIL PROTECTED] To: TWSocket@elists.org Sent: Tuesday, May 03, 2005 10:22 AM Subject: [twsocket] ProcessMessages Hello, I think I must describe my problem a bit more

AW: [twsocket] ProcessMessages

2005-05-03 Thread Markus . Humm
There are two other components in the dll which suffer from the very same problem. One is the timer and another is one for the other communication method which doesn't have a processmessages. Obviously, you failed to have a working message pump. Do you have any hints for these

Re: [twsocket] ProcessMessages

2005-05-03 Thread Francois Piette
- the receiving TWSocket can't be a static component on the datamodule because it has to be in a thread? Yes, the component has to be _created_ within the context of the thread that will handle his events. In case of TWSocket, you have ThreadDetach and ThreadAttach methods if it is not

AW: [twsocket] ProcessMessages

2005-05-03 Thread Markus . Humm
- the sending TWSocket doen't need to be created in an thread because that sends at once (nearly) without the need of windows messages Wrong. Sending and receiving btoh use messages, even if in some cases it seems to be direct. So the sending part must be in another thread and call

RE: [twsocket] ProcessMessages

2005-05-03 Thread Bjørnar Nielsen
. mai 2005 16:26 To: twsocket@elists.org Subject: AW: [twsocket] ProcessMessages - the sending TWSocket doen't need to be created in an thread because that sends at once (nearly) without the need of windows messages Wrong. Sending and receiving btoh use messages, even if in some cases

Re: AW: [twsocket] ProcessMessages

2005-05-03 Thread Wilfried Mestdagh
Hello Markus, So the sending part must be in another thread and call MessageLoop as well until the OnDataSent terminates the thread? No you may only call methods of a component in general in the same thread context as the one where they are created. Same thing for the message pump, you have to

Re: [twsocket] ProcessMessages

2005-05-03 Thread Francois PIETTE
Wrong. Sending and receiving both use messages, even if in some cases it seems to be direct. So the sending part must be in another thread and call MessageLoop as well until the OnDataSent terminates the thread? Or how can I do this? A single thread can handle hundreds of event driven