hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Supun Kamburugamuva <supu...@gmail.com>
Subject Re: When a client closes the connection following exception is thrown
Date Fri, 03 Dec 2010 16:10:26 GMT
It is HttpConnection#shutdown(). But the problem is this exception happens
before I call this method.

Thanks,
Supun..

On Fri, Dec 3, 2010 at 5:20 PM, Oleg Kalnichevski <olegk@apache.org> wrote:

> On Fri, 2010-12-03 at 15:07 +0530, Supun Kamburugamuva wrote:
> > I have a server which uses the HTTPCore NIO. This works fine as long as
> > client behaves nicely. But if the client closes the connection this
> > exception is thrown.
> >
> > java.io.IOException: Broken pipe
> >     at sun.nio.ch.FileDispatcher.write0(Native Method)
> >     at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:29)
> >     at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:100)
> >     at sun.nio.ch.IOUtil.write(IOUtil.java:71)
> >     at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:334)
> >     at
> >
> org.apache.http.impl.nio.reactor.SessionOutputBufferImpl.flush(SessionOutputBufferImpl.java:96)
> >     at
> >
> org.apache.http.impl.nio.DefaultNHttpServerConnection.produceOutput(DefaultNHttpServerConnection.java:194)
> >     at
> >
> org.apache.http.impl.nio.DefaultServerIOEventDispatch.outputReady(DefaultServerIOEventDispatch.java:153)
> >     at
> >
> org.apache.http.impl.nio.reactor.BaseIOReactor.writable(BaseIOReactor.java:185)
> >     at
> >
> org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:338)
> >     at
> >
> org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:315)
> >     at
> >
> org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:275)
> >     at
> >
> org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:104)
> >     at
> >
> org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:542)
> >     at java.lang.Thread.run(Thread.java:680)
> >
> > I'm shutting down the connection in the NHttpServiceHandler's closed
> method.
> > But it seems there is data in the Session Buffer and, even though the
> > connection is closed HTTPCore tries to send this data. Any pointers that
> > guide me in the right direction will be greatly appreciated.
> >
> > Thanks,
> > Supun..
>
> Supun,
>
> What method do you use to close the connection: HttpConnection#close()
> or HttpConnection#shutdown()?
>
> Oleg
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> For additional commands, e-mail: dev-help@hc.apache.org
>
>


-- 
Technical Lead, WSO2 Inc
http://wso2.org
supunk.blogspot.com

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message