Re: Proposed new CometEvent.notify method

2007-05-04 Thread Remy Maucherat
Filip Hanik - Dev Lists wrote: turns out the user found a problem, what I was describing is a possible, but very hard scenario to actual run into. the CoyoteAdapter->read(on a client disconnect) would have to happen at the same time as otherThread->Servlet->write but as you said, he didn't run

Re: Proposed new CometEvent.notify method

2007-05-04 Thread Filip Hanik - Dev Lists
Remy Maucherat wrote: Remy Maucherat wrote: No, I don't agree with reading bytes in the lower layer as it would swallow problems even more than doing it in the adapter without any additional benefit (BTW, read cannot return 0). There's also a likely problem that it would require additional str

Re: Proposed new CometEvent.notify method

2007-05-04 Thread Remy Maucherat
Remy Maucherat wrote: No, I don't agree with reading bytes in the lower layer as it would swallow problems even more than doing it in the adapter without any additional benefit (BTW, read cannot return 0). There's also a likely problem that it would require additional structures to hold that da

Re: Proposed new CometEvent.notify method

2007-05-04 Thread Filip Hanik - Dev Lists
Remy Maucherat wrote: Filip Hanik - Dev Lists wrote: Ok, I'll try something in the meantime in CoyoteAdapter, since it's trivial (and I think does all that is needed at this point). The available() has a side effect, if there is a partial or non valid chunked header (ie the client also sends so

Re: Proposed new CometEvent.notify method

2007-05-03 Thread Remy Maucherat
Filip Hanik - Dev Lists wrote: Ok, I'll try something in the meantime in CoyoteAdapter, since it's trivial (and I think does all that is needed at this point). The available() has a side effect, if there is a partial or non valid chunked header (ie the client also sends some garbage), available(

Re: Proposed new CometEvent.notify method

2007-05-03 Thread Filip Hanik - Dev Lists
Remy Maucherat wrote: Filip Hanik - Dev Lists wrote: It's the contract of this API (which is blocking IO), it's not me ;) I hear you loud and clear, although the API doesn't specify as 0 being an illegal value, it is assumed in many places in the code that the value is either -1 or >0 http://j

Re: Proposed new CometEvent.notify method

2007-05-03 Thread Remy Maucherat
Filip Hanik - Dev Lists wrote: It's the contract of this API (which is blocking IO), it's not me ;) I hear you loud and clear, although the API doesn't specify as 0 being an illegal value, it is assumed in many places in the code that the value is either -1 or >0 http://java.sun.com/j2se/1.5.0/

Re: Proposed new CometEvent.notify method

2007-05-03 Thread Filip Hanik - Dev Lists
Remy Maucherat wrote: Filip Hanik - Dev Lists wrote: No, I don't agree with reading bytes in the lower layer as it would swallow problems even more than doing it in the adapter without any additional benefit (BTW, read cannot return 0). There's also a likely problem that it would require addit

Re: Proposed new CometEvent.notify method

2007-05-03 Thread Remy Maucherat
Filip Hanik - Dev Lists wrote: No, I don't agree with reading bytes in the lower layer as it would swallow problems even more than doing it in the adapter without any additional benefit (BTW, read cannot return 0). There's also a likely problem that it would require additional structures to hol

Re: Proposed new CometEvent.notify method

2007-05-03 Thread Filip Hanik - Dev Lists
Remy Maucherat wrote: Filip Hanik - Dev Lists wrote: yes, but that's ok. the sequence would be this a) available() == 1 b) InputStream.read() == 0 c) available() == 0 what this would mean, is that available()==1 means there is data fetched from the actual socket, may or may not translate into u

Re: Proposed new CometEvent.notify method

2007-05-03 Thread Remy Maucherat
Filip Hanik - Dev Lists wrote: yes, but that's ok. the sequence would be this a) available() == 1 b) InputStream.read() == 0 c) available() == 0 what this would mean, is that available()==1 means there is data fetched from the actual socket, may or may not translate into user data. In the sequen

Re: Proposed new CometEvent.notify method

2007-05-03 Thread Remy Maucherat
Filip Hanik - Dev Lists wrote: Remy Maucherat wrote: Filip Hanik - Dev Lists wrote: Oh by the way, before we start doing all this, I'd really like to push out another "stable" 6.0. There's been tons of bug fixes, and before we put everything on the chopping block again, lets push those out.

Re: Proposed new CometEvent.notify method

2007-05-03 Thread Filip Hanik - Dev Lists
Remy Maucherat wrote: Filip Hanik - Dev Lists wrote: Oh by the way, before we start doing all this, I'd really like to push out another "stable" 6.0. There's been tons of bug fixes, and before we put everything on the chopping block again, lets push those out. It's a possibility, but the cur

Re: Proposed new CometEvent.notify method

2007-05-03 Thread Filip Hanik - Dev Lists
Remy Maucherat wrote: Filip Hanik - Dev Lists wrote: a) make sure it is not registered for READ event b) call event.close() c) call event.notify() - yields a END or NOTIFY event You need to be doing stuff in your servlet somewhere in between too. yes, that's what I meant, this would be in the

Re: Proposed new CometEvent.notify method

2007-05-03 Thread Remy Maucherat
Filip Hanik - Dev Lists wrote: Oh by the way, before we start doing all this, I'd really like to push out another "stable" 6.0. There's been tons of bug fixes, and before we put everything on the chopping block again, lets push those out. It's a possibility, but the current svn is still in the

Re: Proposed new CometEvent.notify method

2007-05-03 Thread Remy Maucherat
Filip Hanik - Dev Lists wrote: a) make sure it is not registered for READ event b) call event.close() c) call event.notify() - yields a END or NOTIFY event You need to be doing stuff in your servlet somewhere in between too. 1. Change "boolean comet =" to "int comet =" or to a list of enum, ba

Re: Proposed new CometEvent.notify method

2007-05-03 Thread Filip Hanik - Dev Lists
Remy Maucherat wrote: Remy Maucherat wrote: Hi, To more conveniently support some use cases, a new notify method could be added to the event. This would do an action callback and call a new method in the Poller class would add the socket to a structure like the socket add list. The comet pol

Re: Proposed new CometEvent.notify method

2007-05-03 Thread Filip Hanik - Dev Lists
Remy Maucherat wrote: Remy Maucherat wrote: Hi, To more conveniently support some use cases, a new notify method could be added to the event. This would do an action callback and call a new method in the Poller class would add the socket to a structure like the socket add list. The comet pol

Re: Proposed new CometEvent.notify method

2007-05-02 Thread Remy Maucherat
Remy Maucherat wrote: Hi, To more conveniently support some use cases, a new notify method could be added to the event. This would do an action callback and call a new method in the Poller class would add the socket to a structure like the socket add list. The comet poller thread will then ch

Proposed new CometEvent.notify method

2007-05-02 Thread Remy Maucherat
Hi, To more conveniently support some use cases, a new notify method could be added to the event. This would do an action callback and call a new method in the Poller class would add the socket to a structure like the socket add list. The comet poller thread will then check if there are socke