Hi Oleg

Thanks for the explanation.. I guess EventListener interface may increasingly be used for protocol handling, and so we could just make it clear in the documentation. I will update the Javadocs with this information.

On a slightly different - but related note, if the remote party was to close the connection abruptly while writing its response entity, and if length delimited encoding was used, it seems like we accept the partial response as a successfully received full response, instead of a socket close. I am trying this with a ESB level unit test and a raw TCP socket server ..

I believe this is caused by the following completion check in read() and transfer():
        if (bytesRead == -1) {
            this.completed = true;
            return -1;
        }

Do you think we should also check if the expected length was received?

thanks
asankha



On 05/11/2011 05:55 PM, Oleg Kalnichevski wrote:
On Wed, 2011-05-11 at 15:19 +0530, Asankha C. Perera wrote:
Hi All

Should the NHttpRequestExecutionHandler.finalizeContext() method be
called before or after a EventListener.connectionClosed() when a remote
party terminates the connection? Right now its called before, and thus
when trying to handle a connection closed event, the state is not
present anymore..

thanks
asankha

Asankha

The order is arbitrary. Initially EventListener interface was meant to
serve merely as an injection point for connection life-cycle logging
rather than as a protocol handler. Feel free to change the sequence in
which those events get fired.

Cheers

Oleg
--
Asankha C. Perera
AdroitLogic, http://adroitlogic.org

http://esbmagic.blogspot.com





---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to