Re: [twsocket] InternalAbort causes OnDataAvailable *during* the Abort call

2010-03-28 Thread DZ-Jay
On Mar 28, 2010, at 07:32, Jon Robertson wrote: > The TriggerSessionClosed (not sure the exact function without looking it up) > was not "aware" that OnDataAvailable had already been called for the current > data. It was only "aware" that there was data that had not been processed > and the sock

Re: [twsocket] InternalAbort causes OnDataAvailable *during* the Abort call

2010-03-28 Thread DZ-Jay
On Mar 28, 2010, at 04:27, Markus Humm wrote: > I never really understood why OnDataAvailable isn't called in a way > which hinders such reetrancy problems. Isn't the Windows message which > triggered it taken off the message queue by then? If not, why not? The problem is that it is not just a m

Re: [twsocket] InternalAbort causes OnDataAvailable *during* the Abort call

2010-03-28 Thread Jon Robertson
In my scenario, OnDataAvailable wasn't called the second time because of the message queue. The socket was being closed, and RcvdCnt > 0, so OnDataAvailable was being called to handle the remaining data. Since my first OnDataAvailable had not finished before the exception occurred, the "metadata"

Re: [twsocket] InternalAbort causes OnDataAvailable *during*the Abort call

2010-03-27 Thread DZ-Jay
On Mar 27, 2010, at 17:34, Jon Robertson wrote: > dZ: Perfect understanding. :) The same happened to me a couple of years ago (as you point out in your previous post). I couldn't fix it then and just made sure that I handle all errors in my OnDataAvailable handler. > While the exception in

Re: [twsocket] InternalAbort causes OnDataAvailable *during*the Abort call

2010-03-27 Thread Jon Robertson
dZ: Perfect understanding. :) While the exception in #3 is the application's fault (my fault), I'm relying on OnBgException to be triggered if an exception occurs inside my OnDataAvailable event. Either I shouldn't do this and ICS users should put their own exception handling inside OnDataAvail

Re: [twsocket] InternalAbort causes OnDataAvailable *during*the Abort call

2010-03-27 Thread DZ-Jay
On Mar 27, 2010, at 13:21, wilfried Mestdagh wrote: > These are possible untested situations. It is possible to call Abort from > within an event, but why should you call Abort if the session is closed? I think that he means that if there is an exception in the OnDataAvailable handler, and you

Re: [twsocket] InternalAbort causes OnDataAvailable *during* the Abort call

2010-03-27 Thread wilfried Mestdagh
sts.org] Namens Jon Robertson Verzonden: vrijdag 26 maart 2010 9:03 Aan: ICS support mailing Onderwerp: Re: [twsocket] InternalAbort causes OnDataAvailable *during* the Abort call On Fri, Mar 26, 2010 at 2:46 AM, Jon Robertson wrote: > In fact, OnDataAvailable has already been called with the exa

Re: [twsocket] InternalAbort causes OnDataAvailable *during* the Abort call

2010-03-26 Thread Jon Robertson
You won't be able to reproduce this. This is only occurring because I've modified the exception handler in ASyncReceive to call HandleBackGroundException, which in turn calls Abort. The version in SVN does not call Abort when an exception occurs in ASyncReceive (or associated event handlers). I'

Re: [twsocket] InternalAbort causes OnDataAvailable *during* the Abort call

2010-03-26 Thread DZ-Jay
On Mar 26, 2010, at 04:02, Jon Robertson wrote: > To clarify, OnDataAvailable has received complete data, say: > help\n > > In processing that data, an exception occurs and TWSocket.Abort is called to > abort the connection. Before .Abort returns, OnDataAvailable is called > again, with the exa

Re: [twsocket] InternalAbort causes OnDataAvailable *during* the Abort call

2010-03-26 Thread Jon Robertson
On Fri, Mar 26, 2010 at 2:46 AM, Jon Robertson wrote: > In fact, OnDataAvailable has already been called with the exact same data. > If OnDataAvailable is called twice with the same data, but the data was only > received once, I consider that a bug. > To clarify, OnDataAvailable has received comp

Re: [twsocket] InternalAbort causes OnDataAvailable *during* the Abort call

2010-03-26 Thread Jon Robertson
In my scenario, the data is "complete" because there are line end characters. In fact, OnDataAvailable has already been called with the exact same data. If OnDataAvailable is called twice with the same data, but the data was only received once, I consider that a bug. Thanks On Fri, Mar 26, 2010

Re: [twsocket] InternalAbort causes OnDataAvailable *during* the Abort call

2010-03-25 Thread wilfried Mestdagh
Hi, It is not a bug, it is by design. The data already received is delivered to the application. The application can easy check if it is complete data by checking the line end character(s). -- mvg, Wilfried http://www.mestdagh.biz -- To unsubscribe or change your settings for TWSocket mailing l