Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 04-29-2004
deepone deepone is offline
Registered User
 
 
Join Date: Apr 2004
Location: Sweden
Posts: 4
Question Transferring files/large data blocks

I would like to be able to pass (potentially large) files between a server and client using ice... I've tried using sequence<byte> and it worked just fine at first but when the files got to a few Mbs things stopped working... (I got an unknown exception from the remote operation)

My setup is something like this:

sequence<byte> ByteData;

interface Client {

void uploadFile( string filename, ByteData data );

};

interface Server {

void login( Client* cli );

};

// in client

server->login( client );

// in server

void
ServerI::login( ClientPrx client, ..... )
{
// read file data
client->uploadFile( filename, data );
}

---

This works for small files, eg the test file I used first was 71k...
For larger files I get "Unknown exception" in the server and ClientI::uploadFile is never reached on the client...

So, is there a recommended way to do this?
Reply With Quote
  #2 (permalink)  
Old 04-29-2004
ganzuoni ganzuoni is offline
Registered User
 
Name: Guido Anzuoni
Organization: Individual
Project: No specific project
 
Join Date: Jun 2003
Location: Italy
Posts: 46
I think that you should consider a chunked transfer approach.

Something like:


sequence<byte> ByteData;

interface Receiver {

void receive( ByteData data);
void close();

};



interface Server {

Receiver *transfer( string filename);

};

Your client will send multiple chunks of the original file
invoking multiple receive() until EOF.

I have used this approach in Java and it is really ***fast***
(well, ftp is a little bit faster but....you have no objects !!)
You can experience the performances using different chunk size.
64K it is rather good.


Hope it helps,

Guido.
Reply With Quote
  #3 (permalink)  
Old 04-29-2004
marc's Avatar
marc marc is offline
ZeroC Staff
 
Name: Marc Laukien
Organization: ZeroC, Inc.
Project: The Internet Communications Engine
 
Join Date: Feb 2003
Location: Florida
Posts: 1,781
Hmm... you shouldn't get an UnknownException, but instead a MemoryLimitException.

You can increase the max message size by setting the property Ice.MessageSizeMax. The default is 1024, meaning 1024 KB = 1MB. Try setting it to a larger value, like 10240 = 10MB.

For more information, have a look at the description of the MessageSizeMax property in the manual's reference section.

If you would like to see an example for transferring arbitrary long files in "chunks", have a look at the code of IcePatch in src/IcePatch.
Reply With Quote
  #4 (permalink)  
Old 04-29-2004
deepone deepone is offline
Registered User
 
 
Join Date: Apr 2004
Location: Sweden
Posts: 4
Thanks... Good stuff...
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
IcePy, large sequences huberthoegl Help Center 6 01-11-2006 05:19 AM
Use ICE to send large files(C++)? thelONE Help Center 6 10-15-2005 09:18 PM
Question about sending large data. JaneShang Help Center 3 10-14-2005 01:25 PM
Large chunks of data mwilson Help Center 6 09-12-2005 11:37 PM
IcePack.Registry.Data and IcePack.Node.Data directories vsonnathi Comments 0 10-21-2004 06:12 PM


All times are GMT -4. The time now is 08:14 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.