Hello Markus,

> For the receiving part I did this (the contents of tthread execute):
>     udp.MessageLoop;

Are you very sure this is exacly what you want ?  MessageLoop will
pump messages, but will actually stay there until a WM_QUIT is received.
If you dont watch carefully you will end up with a lots of loops pumping
messages and consuming CPU in your application.

In my opinion you are making it very difficult trying to sequentional
programming with event driven components.

In fact you onle need in Execute method of thread:

// create all of your components
// assigne all event handlers
// destroy them all

that's all you have to do !
all the rest is the same as in normal programming with the exception
that you have to do thread safe code of course !

Rgds, Wilfried

Tuesday, May 3, 2005, 17:14, [EMAIL PROTECTED] wrote:

> Hello,

> after sendin I have now (only for test purposes) a 100 ms loop
> which calls twsocket's processmessages. The result is, that sending
> now works fine again from the test app. and the test app. responds 
> to mouse clicks etc. again.

> For the receiving part I did this (the contents of tthread execute):

>   try
>     udp:=TWSocket.Create(nil);
>     udp.addr           :=ip;
>     udp.Port           :=port;
>     udp.Proto          :='udp';
>     udp.SendFlags      :=wsSendNormal;
>     udp.MultiThreaded  :=true;
>     udp.OnDataAvailable:=dm.udpDataAvailable;

>     udp.Listen;

>     udp.MessageLoop;
>   except
>     exit;
>   end;

> with dm.udpdataavailable the former dataavailable from the socket which
> was placed statically on a datamodule and did formerly the receiving part.

> The thread is started, but  can't receive anything. OnDataAvailable doesn't
> fire although there is data available.

> What's wrong with it? It seems I'm near the solution, but haven't got it
> yet.

> Greetings

> Markus Humm

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