ChannelFutureProgressListener interface not working as expected!

Fahad Kalil fahadkalil at gmail.com
Mon Aug 16 14:58:05 EDT 2010


Trustin,

Thanks for the reply..
I'm using on Windows enviroment, so now I know why it's not working as
expected!

I've checked some other threads and solved my problem using the well-known
ChannelFutureListener interface.

Bye,
Fahad

2010/8/16 Trustin Lee [via Netty Forums and Mailing Lists] <
ml-node+5426778-1065293642-125623 at n2.nabble.com<ml-node%2B5426778-1065293642-125623 at n2.nabble.com>
>

> Hello Fahad,
>
> It works for me on my Fedora 13 Linux.  What is your environment?  On
> Windows, it may not work, but I don't remember exactly.  Zero copy file
> transfer in Windows is broken anyway - please check out the FileRegion
> API documentation.
>
> HTH,
> Trustin
>
> On 07/15/2010 11:14 AM, Fahad Kalil wrote:
>
> >
> > Hello,
> >
> > I'm a new user of the Netty API.
> > My question is about the new ChannelFutureProgressListener interface.
> >
> > I have the code above (based on the HttpStaticFileServerHandler example):
>
> >
> >
> > public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) {
>
> >    Channel ch = e.getChannel();
> >    ChannelFuture writeFuture;
> >    ...
> >    final FileRegion region = new DefaultFileRegion(raf.getChannel(), 0,
> > fileLength);
> >    writeFuture = ch.write(region);
> >    writeFuture.addListener(new ChannelFutureProgressListener() {
> >       public void operationComplete(ChannelFuture future) {
> >          region.releaseExternalResources();
> >          System.out.println("Transfer Done!");
> >       }
> >
> >       public void operationProgressed(ChannelFuture future, long amount,
> > long current, long total) {
> >          System.out.println("Transferring...");
> >          System.out.printf("%d / %d (+%d)%n", current, total, amount);
> >       }
> >    });
> >
> > The problem is that 'operationProgressed' is never accessed/called during
>
> > the transfer process.
> > I've tried to use that interface to have access to data about the
> transfer
> > and show in a GUI for the user.
> >
> > The transfer worked (and the method operationComplete is accessed),
> except
> > for the operationProgressed method.
> >
> > Any help would be welcome.
> > Thanks.
> >
> --
> what we call human nature in actuality is human habit
> http://gleamynode.net/
>
>
>
> _______________________________________________
> netty-users mailing list
> [hidden email] <http://user/SendEmail.jtp?type=node&node=5426778&i=0>
> https://lists.jboss.org/mailman/listinfo/netty-users
>
> *signature.asc* (301 bytes) Download Attachment<http://attachment/5426778/0/signature.asc>
> what we call human nature in actuality is human habit
> http://gleamynode.net/
>
>
> ------------------------------
>  View message @
> http://netty-forums-and-mailing-lists.685743.n2.nabble.com/ChannelFutureProgressListener-interface-not-working-as-expected-tp5295655p5426778.html
> To unsubscribe from ChannelFutureProgressListener interface not working as
> expected!, click here<http://netty-forums-and-mailing-lists.685743.n2.nabble.com/template/NodeServlet.jtp?tpl=unsubscribe_by_code&node=5295655&code=ZmFoYWRrYWxpbEBnbWFpbC5jb218NTI5NTY1NXwtMTkzOTc3NDM5OA==>.
>
>
>


-- 
FAHAD KALIL
Mestrando em Computação - UFRGS
Bacharel em Ciência da Computação - UPF

-- 
View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/ChannelFutureProgressListener-interface-not-working-as-expected-tp5295655p5429070.html
Sent from the Netty User Group mailing list archive at Nabble.com.



More information about the netty-users mailing list