Netty and JavaFX
Marc-André Laverdière
marcandre.laverdiere at gmail.com
Tue Jun 29 03:51:04 EDT 2010
Sorry for not replying to this earlier...
It looks like you are not enforcing boundaries between your objects,
so you get parts of one image into the other one. Maybe sending with a
length header would help.
Marc-André LAVERDIÈRE
"Perseverance must finish its work so that you may be mature and
complete, not lacking anything." -James 1:4
mlaverd.theunixplace.com/blog
/"\
\ / ASCII Ribbon Campaign
X against HTML e-mail
/ \
2010/6/24 bgoetzmann <bgoetzmann at sophia.symag.com>:
>
> 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.
> _______________________________________________
> netty-users mailing list
> netty-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/netty-users
>
More information about the netty-users
mailing list