Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 04-11-2004
xdm's Avatar
xdm xdm is offline
ZeroC Staff
 
Name: José Gutíerrez de la Concha Martínez
Organization: ZeroC, Inc.
Project: Ice Developer
 
Join Date: Sep 2003
Location: La Coruña, Spain
Posts: 291
Ice::MemoryLimitException

Hellow i trying to develop a simple file transfer util.


i define the next slice types
Code:

sequence<byte> Bytes;
sequence<long> ChunkRefs;

struct Chunk
{
	long id;
	Bytes content;
};

dictionary<long,Chunk> ChunksMap;

interface FileReader
{
	nonmutating ChunksMap read();
	nonmutating ChunkRefs getChunkRefs();
	nonmutating Chunk readChunk(long id);
	nonmutating int getChunkSize();
};

interface FileWriter
{
	idempotent bool write(File source);
	idempotent bool addChunk(Chunk source);
}

class File extends Node implements FileReader,FileWriter
{
	int chunkSize;
	ChunksMap content;
};
then i write a FileLoader class with the next upload method
Code:
bool FileLoader::upload(const string& filePath)
{
	bool retval;
	if(QFile::exists(filePath))
	{
		ifstream source(filePath.c_str(),ios::binary);
		if(source)
		{
			long chunk_id=0;
			cout<<"Chunk size is: "<<target->getChunkSize()<<endl;
			while(!source.eof())
			{
				/*Creating a new chunk for add in to the file*/
				Chunk chunk;
				chunk.id=chunk_id;
				chunk_id++;
				
				chunk.content.resize(target->getChunkSize());
				source.read(reinterpret_cast<char*>(&chunk.content[0]),chunk.content.size());
				/*
					upload the new chunk to target File
				*/
				target->addChunk(chunk);
			}
			cout<<"source file upload ok"<<endl;
		}
		source.close();
		retval=true;
	}
	else
		cout<<"File: "<<filePath<<" no Exist"<<endl;
	return retval;
}
This method works fine with small files. When i used this method whit a file of 6 Mb the next thing ocurrs

the method runs ok but in the next ivocation of any method i received the next exception error

Code:
File: error: Saving thread killed by exception: ../../include/Ice/BasicStream.h:55:  Ice::MemoryLimitException:
 protocol error: memory limit exceeded
I store my Files in server using a Freeze::evictor

can any body sayme what's the troubel in my program?

Tanks in advantage
Reply With Quote
  #2 (permalink)  
Old 04-11-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
Try setting the property Ice.MessageSizeMax to a higher value. The default is 1024, meaning 1024 KB = 1MB.
Reply With Quote
  #3 (permalink)  
Old 04-11-2004
xdm's Avatar
xdm xdm is offline
ZeroC Staff
 
Name: José Gutíerrez de la Concha Martínez
Organization: ZeroC, Inc.
Project: Ice Developer
 
Join Date: Sep 2003
Location: La Coruña, Spain
Posts: 291
thanks mark

thanks mark i set Ice.MessageSizeMax=10240 and now i can upload large files ok
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


All times are GMT -4. The time now is 01:21 PM.


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.