[omniORB] transfer large files

Matej Kenda matejken at gmail.com
Fri Sep 19 20:19:43 BST 2008


On Fri, Sep 19, 2008 at 6:19 PM, Antonio Beamud Montero
<antonio.beamud at gmail.com> wrote:
> El vie, 19-09-2008 a las 17:42 +0200, Matej Kenda escribió:
>> Hi Antonio,
>>
>> I used sequence of octets for sending files.
>
> Then, the file is entirely loaded in memory before be sent... no?

No, it doesn't have to be.

You can send large files by reading and sending chunks in a loop.

<pseudo>

file.open();
file_server.open_file(fname);
octet_sequence buffer;
buffer.length(32*1024);

while (!file.eof()) {
    file.read(buffer);
    file_server->put(buffer);
}

file.close();
file_server.close();

</pseudo>

HTH,

Matej


More information about the omniORB-list mailing list