I use the example of Inter Process Communication with Client Server Async Example ( in S60 SDK Symbian 8.0a).
Now I have to exchange more data, from server to client (until 5k Byte).
I try to use HBufC but I don't konw the right way.
I try this:
void RServerSession::Request( TDes8& aReq, TDes8& aRes, TRequestStatus& aStatus)
{
const TAny* messageParameters[KMaxMessageArguments];
iDataTx.Set( reinterpret_cast<TUint8*>( &aReq ), sizeof( aReq ), sizeof( aReq ) );
iDataRx.Set( reinterpret_cast<TUint8*>( &aRes), sizeof( aRes), sizeof( aRes) );
p[0] = static_cast<TAny*> ( &iDataTx );
p[1] = static_cast<TAny*>( &iDataRx );
SendReceive( EPssbServRequestCommandPerform, p, aStatus );
}
Where in RServerSession:
TPtr8 iDataTx;
TPtr8 iDataRx;
and in the I call this function from the Handler with:
iRServerSession.Request( iCommand, iResponse, iStatus );
Where in the Handler.h:
HBufC8* iCommand;
HBufC8* iResponse;
and in the Handler::ConstructL()
iCommand = HBufC8::NewL(5069);
iResponse = HBufC8::NewL(5069);
BUT when i run this code, in the server side, I can't read the data and when I try to use iMessage.WriteL in this way:
_LIT8(KResponse, "tx file: 0123456789123456789");
TBuf8<100> response(KResponse);
TRAPD( resW, iMessage.WriteL( iMessage.Ptr1(), response) );
The resW is equal at KErrOverflow=(-9);
My question is:
Is there a way to exchange data using HBufC between client and server?

Reply With Quote

