Re: [twsocket] OnDataAvailable and Reetrancy

2006-09-01 Thread Arno Garrels
Markus Humm wrote: I don't call processmessages and the like directly in the event but might output some lines on screen for debugging. How? ShowMessage is a modal form. Other thing: what about critical sections. Would they be safe for preventing this in my situation? No, critical

Re: [twsocket] OnDataAvailable and Reetrancy

2006-09-01 Thread Francois Piette
of MidWare (Multi-tier framework, freeware) http://www.overbyte.be - Original Message - From: Markus Humm [EMAIL PROTECTED] To: twsocket@elists.org Sent: Friday, September 01, 2006 7:25 AM Subject: [twsocket] OnDataAvailable and Reetrancy Can OnDataAvailable be called while

Re: [twsocket] OnDataAvailable and Reetrancy

2006-09-01 Thread Wilfried Mestdagh
But TWSocket will swallow the exception, so use this: var AFlag:Boolean procedure TForm.WSocketDataAvailable(Sender: TObject; ErrCode: Word); begin try if AFlag then raise Exception.Create('reentered'); AFlag := TRUE; try [..] finally

[twsocket] OnDataAvailable and reetrancy

2006-08-31 Thread Markus Humm
Hello, I've a server and a client app. which communicate through a TCP based protocoll I designed. The server get's requests which in OnDataAvailable are received into a 1500 Byte sized array (most time the app. will run on a LAN) whose contents is copied into a larger buffer then since the

Re: [twsocket] OnDataAvailable and reetrancy

2006-08-31 Thread Francois PIETTE
: Thursday, August 31, 2006 8:20 PM Subject: [twsocket] OnDataAvailable and reetrancy Hello, I've a server and a client app. which communicate through a TCP based protocoll I designed. The server get's requests which in OnDataAvailable are received into a 1500 Byte sized array (most time the app

[twsocket] OnDataAvailable and Reetrancy

2006-08-31 Thread Markus Humm
Can OnDataAvailable be called while it is already running? And if yes, how to prevent this? Is using critical sections a good idea here? You must avoid having the events reentered. To avoid this, you simply have to _not_ call any form of the message pump from the events. The message