×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Mar 2003
    Location
    Italy - Tourin
    Posts
    19

    Post Client Server (Async) exchange HBufC data type

    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?

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,689

    Re: Client Server (Async) exchange HBufC data type

    sizeof(TDes8) is not something I would use in this case. I would rather use TDes8::Length and TDes8::MaxLength.
    Last edited by wizard_hu_; 2006-11-02 at 19:06.

  3. #3
    Registered User
    Join Date
    Mar 2003
    Location
    Italy - Tourin
    Posts
    19

    Re: Client Server (Async) exchange HBufC data type

    thanks to replay.

    I use your suggestion but It doesn't work on mobile
    In the server i see
    RMessage.WriteL = -38

Similar Threads

  1. Client and Server Program
    By Ravikumar in forum Symbian Networking & Messaging (Closed)
    Replies: 2
    Last Post: 2006-09-18, 14:41
  2. Bluetooth client problem on games!
    By wmchan78 in forum Mobile Java Networking & Messaging & Security
    Replies: 6
    Last Post: 2006-03-22, 06:15
  3. error sending data to the server. SymbianOS error -1
    By dihex in forum Mobile Java Networking & Messaging & Security
    Replies: 0
    Last Post: 2005-11-15, 18:55
  4. Cannot to receive data from server...
    By ramis55 in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2005-05-09, 13:46
  5. Problem with Nokia D211 Linux Drivers
    By fiveam in forum Multimodecards
    Replies: 1
    Last Post: 1970-01-01, 02:00

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×