You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Geoff Cadien <gc...@gmail.com> on 2008/06/03 23:28:13 UTC

AbstractIoSession Creates DefaultFileRegion Instances

I am currently looking at adding sendfile support to the APR transport.  One
thing I'm trying to do is abstract out knowledge about the transport from
FileRegion, currently FileRegion relies on FileChannel which ties it to
NIO.  AbstractIoSession creates instances of DefaultFileRegion if the
message written is either a FileChannel or a File.  So I'm wondering if
AbstractIoSession should really be creating instances of DefaultFileRegion
(it's causing me some pain :-) )

-geoff

Re: AbstractIoSession Creates DefaultFileRegion Instances

Posted by Geoff Cadien <gc...@gmail.com>.
On Wed, Jun 4, 2008 at 12:13 AM, Julien Vermillard <jv...@archean.fr>
wrote:

> On Tue, 3 Jun 2008 14:28:13 -0700
> "Geoff Cadien" <gc...@gmail.com> wrote:
>
> > I am currently looking at adding sendfile support to the APR
> > transport.  One thing I'm trying to do is abstract out knowledge
> > about the transport from FileRegion, currently FileRegion relies on
> > FileChannel which ties it to NIO.  AbstractIoSession creates
> > instances of DefaultFileRegion if the message written is either a
> > FileChannel or a File.  So I'm wondering if AbstractIoSession should
> > really be creating instances of DefaultFileRegion (it's causing me
> > some pain :-) )
> >
> > -geoff
>
> Hi Geoff,
>
> Yep when I started playing with APR I stumbled on the same problem. I
> think we need to redo FileRegion system for being less NIO dependent.
>
> Feel free to create an issue and attach patches ;)


That's the plan. :-)  But right now my solution was to simply comment out
the construction of a DefaultFileRegion in AbstractIoSession since the
changes I've made remove FileChannel from DefaultFileRegion.

-geoff

Re: AbstractIoSession Creates DefaultFileRegion Instances

Posted by Julien Vermillard <jv...@archean.fr>.
On Tue, 3 Jun 2008 14:28:13 -0700
"Geoff Cadien" <gc...@gmail.com> wrote:

> I am currently looking at adding sendfile support to the APR
> transport.  One thing I'm trying to do is abstract out knowledge
> about the transport from FileRegion, currently FileRegion relies on
> FileChannel which ties it to NIO.  AbstractIoSession creates
> instances of DefaultFileRegion if the message written is either a
> FileChannel or a File.  So I'm wondering if AbstractIoSession should
> really be creating instances of DefaultFileRegion (it's causing me
> some pain :-) )
> 
> -geoff

Hi Geoff,

Yep when I started playing with APR I stumbled on the same problem. I
think we need to redo FileRegion system for being less NIO dependent.

Feel free to create an issue and attach patches ;)

Julien