Discussion Board

Results 1 to 5 of 5
  1. #1
    Regular Contributor hendrawan.ashari's Avatar
    Join Date
    Nov 2006
    Location
    Brebes, Indonesia
    Posts
    129
    I have implementation Socket (from socket example) for my application.
    i have 1 problem, while i receie data from server i can't know while data transfer done.
    Some one can help me ?

    this my code, but not work welly
    vvoid CWAPServSocketsReader::RunL()
    {
    // Active object request complete handler
    switch (iStatus.Int())
    {
    case KErrNone:
    {
    // Character has been read from socket
    iEngineNotifier.ResponseReceived(iBuffer);
    IssueRead(); // Immediately start another read
    break;

    }
    case KErrEof:
    {
    // if all data has been transferred i want to get information not
    _LIT(message,"Done!");
    CAknInformationNote* finishedNote = new (ELeave) CAknInformationNote;
    finishedNote->ExecuteLD(message);
    }
    case KErrDisconnected:
    {
    iEngineNotifier.ReportError(MEngineNotifier::EDisconnected,
    iStatus.Int());
    break;
    }
    default:
    {
    iEngineNotifier.ReportError(MEngineNotifier::EGeneralReadError,
    iStatus.Int());
    break;
    }
    }
    }
    thanks for respons
    http://blogehendrawan.blogspot.com - Kembangin symbian di Indonesia yukk....

  2. #2
    Nokia Developer Moderator wizard_hu_'s Avatar
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    27,747
    KErrEof might not be the solution you need, since it is triggered when the socket gets closed on the other end.

  3. #3
    Regular Contributor hendrawan.ashari's Avatar
    Join Date
    Nov 2006
    Location
    Brebes, Indonesia
    Posts
    129
    some one can give me some information, how to know while all data has been transfered or how to solve my problem.
    Last edited by hendrawan.ashari; 2006-11-16 at 12:17.
    http://blogehendrawan.blogspot.com - Kembangin symbian di Indonesia yukk....

  4. #4
    Registered User david.caabeiro's Avatar
    Join Date
    Apr 2005
    Location
    Barcelona
    Posts
    1,678
    You could agree on some format which sends the length of the data beforehand. Think of http's content-length header.

  5. #5
    Nokia Developer Moderator wizard_hu_'s Avatar
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    27,747
    Quote Originally Posted by hendrawan.ashari
    some one can give me some information, how to know while all data has been transfered or how to solve my problem.
    There is no such thing as "all data", you need to be more specific.
    If you are sending 5 bytes, you should give a TBuf8<5> to RSocket::Read, and when it completes, you will automatically have "all data". If you are communicating with a web-server, you should rather use RecvOneOrMore, concatenating the received segments until you find a double-linebreak which closes the header-part. Etc.

Similar Threads

  1. semacode Reader SDK prob
    By MarcelHeckermann in forum Mobile Java Tools & SDKs
    Replies: 4
    Last Post: 2006-09-12, 01:22
  2. YUCCA Help : BT Sockets : Wierd Problem??
    By mayur_24 in forum Symbian C++
    Replies: 5
    Last Post: 2004-09-20, 12:18
  3. Reading with sockets
    By _fox in forum Symbian Networking & Messaging (Closed)
    Replies: 3
    Last Post: 2004-07-01, 13:11
  4. Questions about sockets, I need help.
    By _fox in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2004-06-10, 10:29
  5. Where to find application that uses sockets?
    By doctordwarf in forum Mobile Java General
    Replies: 1
    Last Post: 2004-03-10, 15:45

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved