philippe.tseyen wrote:
I'm trying to do something similar here, but the files I'm sending over are
bigger (100MB or larger). So I would rather not load this into memory.

The protocol I would like to have is as follows.

Client -> Server: Request (message)
Server -> Client: OK (message)
Client -> Server: Filesize
Here I would like the client to pump over the data; on the server I want to
stream the data directly as it arrives into a file as opposed to loading it
all into memory first.

Basically I'm looking for something where I can mix message handling with
streaming functionality.
It's not something complicated assuming you know which size your file will be. In this case, you just have to store the incoming data into a file. You just have to write your own protocol codec filter.

Using a cumulative protocol codec is certainly not an option in this case.

Remember that you receive bytes, and it's up to you to store them into the best possible structure for your need. MINA does nothing more than reading and writing bytes from and into a socket, everything else are just special handling of specific cases...

--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org


Reply via email to