PDA

View Full Version : Qcopservicerequest



void*
5th February 2007, 07:26
Hi,

How can I send a QStringList containing a huge list of filenames to another application for processing.

I am using QCopServiceRequest APIs to achieve this. But when the size of string list increases then the service request to other application fails.

Code snippet:

In main application,
QCopServiceRequest req("CalleeApplication","MyFunc(QStringList)");
req << fileList; //filelist is QStringList containing list of items
req.send();

------
In CalleApplication,
void CalleeApplication::MyFunc(const QStringList& list)
{
...
.... // processing data
}


----------------
On execution of main application, it is capable of opening CalleApplication but since the data sent is big enough, the application quickly fails. the Greenphone logs show the following
----------------------
MenuManager::eventFilter
Feb 5 11:11:18 greenphonesdk x86: HITESH: filelist = 1112
Feb 5 11:11:18 greenphonesdk x86: HITESH: address = 809d118
Feb 5 11:11:18 greenphonesdk x86: qws_read_command: Won't read command of length 145656, connection closed.
Feb 5 11:11:18 greenphonesdk x86: QWSLock::lock: Invalid argument
Feb 5 11:11:18 greenphonesdk x86: QWSLock::unlock: Invalid argument
Feb 5 11:11:18 greenphonesdk x86: QWSLock::lock: Invalid argument
Feb 5 11:11:18 greenphonesdk last message repeated 2 times
Feb 5 11:11:18 greenphonesdk x86: QAbstractSocket::waitForBytesWritten() is not allowed in UnconnectedState

-------------------

what I understood from the above log is that there is limit to send the amount of data through cop service request. If I reduce the size of filelist, the processing goes fine.

Now, My question is, how it is possible to send big data using QCopServiceRequest? I was also trying to pass on the pointer to data (pass by reference) but that also fails to process, most probably because both the applications run as different process.

any help in this regard please..

thanks a lot.

Warm regards
void*

wysota
6th February 2007, 14:01
Maybe you could either divide the command into two pieces or compress the data before sending?