Network file transfer
metalstorm
metalheadstorm at gmail.com
Tue Oct 11 02:37:03 EDT 2011
Thank you for your reply Norman,
For my little and somwhat basic test app I have this as my client and server
pipelineFactory ( copied from a tutorial)
// pipeline.addLast("framer", new DelimiterBasedFrameDecoder(8192,
// Delimiters.lineDelimiter()));
pipeline.addLast("decoder", new StringDecoder());
pipeline.addLast("encoder", new StringEncoder());
// and then business logic.
pipeline.addLast("handler", new TimeClientHandler());
I think i understand what each part does, i just don't know how to go about
it. (I understand the business handler class thought, that's all fine for
now i think)
'Framer' was removed in this example because messages would have to have
/n/r at the end to be read / writen, which i didn't want.
So from the docs:
Protocol Decoder - translates binary data (e.g. ChannelBuffer) into a Java
object.
Protocol Encoder - translates a Java object into binary data.
So for c# sending files over tcp, data is read from a file into a fileStream
then out of that into a networkstream which then goes the opposite was at
the other end.
So in netty, once data is read from a file into a filestream what process
must it go through (encoder) before it is sent, from what i understand it is
already in binary data; which begs the question what about the other end as
well.
I cannot see what a framer would do in this situation (but tbh i'm not
entirely sure what a framer does really)
Finally, you say you can't block the thread so you can't do while(read)
think of thing, how else is reading from the network and writing to a file
accomplished?
Thank you for your time.
P.s I am a kinesthetic learner, please provide source code where possible so
that I can learn and build upon it.
--
View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Network-file-transfer-tp6875434p6879776.html
Sent from the Netty User Group mailing list archive at Nabble.com.
More information about the netty-users
mailing list