Netty and JavaFX

bgoetzmann bgoetzmann at sophia.symag.com
Thu Jun 24 08:09:39 EDT 2010


Hello,

I'm working on an application using JavaFX and Netty (3.2.1) for transfering
large files, and it works well: the JavaFX user interface shows progress
bars when the applications receives files. It cans act as a client for
sending files, or as a server for receiving files.

For the client part, I used the class ChunkedWriteHandler in order to send a
file, and for the server part, the bytes are written using a
RandomAccessFile class.

I made a lot of image file tranfers, and I note the problem that sometimes
the received file is not correct: the written file has exactly the same
number of bytes, but can't be displayed; when doing a binary comparaison
between the original and created files, it appears that the beginning and
the ending of these files are not identical but the middle yes.

Any idea?

Here the way I write a file on the disk:

// An RandomAccessFile is create at the beginning of the connection
raf = new RandomAccessFile(new File("D:/temp/test.jpg"), "rw" );
...

// Used in messageReceived method
ChannelBuffer buf = (ChannelBuffer) e.getMessage();
buf.readBytes(raf.getChannel(), buf.readableBytes());


Thank you for any idea or suggestion!

Bertrand.
http://www.odelia-technologies.com/
-- 
View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Netty-and-JavaFX-tp5217198p5217198.html
Sent from the Netty User Group mailing list archive at Nabble.com.


More information about the netty-users mailing list