users@grizzly.java.net

Re: ReadHandler not returning error on client disconnect

From: Oleksiy Stashok <oleksiy.stashok_at_oracle.com>
Date: Wed, 30 Mar 2011 09:54:25 -0700

Hi Gagan,
agree with Ryan, please file the issue...

One more thing, can you pls. try if you see the same when using Grizzly
2.0.1-SNAPSHOT?

Thanks.

WBR,
Alexey.

On 03/30/2011 02:04 AM, gagansnt wrote:
> I am using Grizzly NIOInputStream and response suspend/resume facility to
> read from clients.
> Problem I am facing, When a client stops sending file due some error or
> network problem then I do not get any exception or error message on server
> side. I am using exactly the same code as mentioned in one of the samples on
> Grizzly website - Do I need to make any further changes in code in order to
> know that client has stopped sending data.
>
> in.notifyAvailable(new ReadHandler() {
> @Override
> public void onDataAvailable(){
> try {
> doWrite(this, in, buf, out, parser);
> } catch (IOException e) {
> logger.fatal(e.toString());
> }catch (Exception e) {
> logger.fatal(e.toString());
> }
> }
> @Override
> public void onError(Throwable t) {
> logger.info(inputFile+" [onError]" + t.toString());
> System.out.println(inputFile + " [onError]" + t.toString());
> }
> @Override
> public void onAllDataRead() {
> System.out.println("[onAllDataRead] length: " + in.readyData());
> logger.info("[onAllDataRead] length: " + in.readyData());
> try {
> doWrite(this, in, buf, out, parser);
> } catch (IOException e) {
> logger.fatal(e.toString());
> }
> response.resume();
> }
> });
>
>
> Thanks in advance
> Gagan
>
> --
> View this message in context: http://grizzly.1045725.n5.nabble.com/ReadHandler-not-returning-error-on-client-disconnect-tp4271055p4271055.html
> Sent from the Grizzly - Users mailing list archive at Nabble.com.