[undertow-dev] AbstractFixedLengthStreamSinkConduit

Jeff Williams jeffw at wherethebitsroam.com
Mon Nov 3 16:15:00 EST 2014


Thanks for the tips. My local flush was actually based on
org.xnio.conduits.BufferedStreamSinkConduit including a terminated flag,
except that i was also passing terminateWrites() on to the delegate. I'll
try it with writeFinal() instead.

Jeff
On 03/11/2014 9:11 PM, "Stuart Douglas" <sdouglas at redhat.com> wrote:

> org.xnio.conduits.BufferedStreamSinkConduit is probably a good example,
> although it does not use writeFinal().
>
> Stuart
>
> ----- Original Message -----
> > From: "Stuart Douglas" <sdouglas at redhat.com>
> > To: "Jeff Williams" <jeffw at wherethebitsroam.com>
> > Cc: undertow-dev at lists.jboss.org
> > Sent: Tuesday, 4 November, 2014 7:10:53 AM
> > Subject: Re: [undertow-dev] AbstractFixedLengthStreamSinkConduit
> >
> > You need to not pass on the terminateWrites() call to the delegate until
> your
> > have written all your data.
> >
> > Once terminateWrites is called on your channel set some kind of boolean
> flag
> > to indicate that this is shutdown, and then when the user calls flush()
> > write out the buffer (using writeFinal for best performance). If you are
> not
> > using writeFinal() then you need to call terminateWrites() once you
> succeed
> > in flushing, and then pass further flush calls to the delegate.
> >
> > Stuart
> >
> > ----- Original Message -----
> > > From: "Jeff Williams" <jeffw at wherethebitsroam.com>
> > > To: undertow-dev at lists.jboss.org
> > > Sent: Monday, 3 November, 2014 11:48:10 PM
> > > Subject: [undertow-dev] AbstractFixedLengthStreamSinkConduit
> > >
> > > Hi,
> > >
> > > I have written a StreamSinkConduit which buffers content in a pooled
> > > buffer.
> > > I am having an issue with AbstractFixedLengthStreamSinkConduit
> throwing a
> > > FixedLengthUnderflowException exception.
> > >
> > > If I have content left in my buffer which I have not yet been able to
> write
> > > to the next conduit when terminateWrites is called, the exception is
> > > thrown.
> > > Even though this content would have been written in the subsequent
> call to
> > > flush. Shouldn't the bytes remaining be checked after a successful
> flush
> > > rather than in terminateWrites? Or am I missing something?
> > >
> > > For the time being I am flushing my local buffer in terminateWrites,
> but
> > > this
> > > seems wrong!
> > >
> > > Jeff
> > >
> > > _______________________________________________
> > > undertow-dev mailing list
> > > undertow-dev at lists.jboss.org
> > > https://lists.jboss.org/mailman/listinfo/undertow-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20141103/3ca36aaa/attachment-0001.html 


More information about the undertow-dev mailing list