Discussion Board

Results 1 to 5 of 5
  1. #1
    Regular Contributor xchewy's Avatar
    Join Date
    Jan 2008
    Posts
    70
    Hi, i'm facing a situation where i need to send many descriptors trough socket but if i use a loop to send an item after another it only sends the first one, i dont know how to solve this

    i am using an AO_A that puts data into AO_B obtect that uses a timer to do its job, when this timer ends i have another AO, AO_C that really sends a descriptor (just one per call), but the behavior is like i wrote the firts paragraph.

    i don't know if i have too many active objects, maybe i can merge the AO_B and AO_C to use just two active objects, and its is sane to have many active objetcs??? thank you

  2. #2
    Nokia Developer Moderator ltomuta's Avatar
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,335
    You definitely have two many AOs, one is more than enough for sending (you might need another one for reading from the socket if you also receive some data).

    However, as long as the AOs work correctly all the passed data should eventually get to the object AO_C and therefore it should be sent out.

  3. #3
    Regular Contributor xchewy's Avatar
    Join Date
    Jan 2008
    Posts
    70
    ok, but how can i prevent the do it once of my write into socket method, because, it ends the loop but, each time the socket writes it enters the Active state again, so its kind of nested behavior i have here and cant see how to solve it

  4. #4
    Nokia Developer Moderator ltomuta's Avatar
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,335
    I'm not sure that I understand your question ...

    You can have something like

    Code:
    void CWriterAO::Send(const TDesC8& aMessage)
    {
       AddToQueue();
       if(!IsActive())
          SendNext();
    }
    
    void CWriterAO::SendNext()
    {
    
        iSocket->Write(iStatus, FirstInQueue());
        SetActive();
    }
    
    void CWriterAO::RunL()
    {
        User::LeaveIfError(iStatus.Int);
        if(!IsQueueEmpty())
            SendNext();
    }
    Last edited by ltomuta; 2008-06-23 at 18:58. Reason: Send() is in fact SendNext()

  5. #5
    Regular Contributor xchewy's Avatar
    Join Date
    Jan 2008
    Posts
    70
    no but you give me some clues, really thank you

Similar Threads

  1. Replies: 1
    Last Post: 2007-12-10, 14:41
  2. Sending sound over a TCP socket in Symbian C++ 3650
    By tippu in forum Symbian Networking & Messaging (Closed)
    Replies: 2
    Last Post: 2003-10-21, 10:15
  3. Sending Ringtones to a 3320 phone trough the IrDA Port
    By djromero in forum General Messaging
    Replies: 1
    Last Post: 2002-11-21, 09:32
  4. Sending Ringtones to a 3320 phone trough the IrDA Port
    By djromero in forum PC Suite API and PC Connectivity SDK
    Replies: 1
    Last Post: 2002-11-21, 04:07
  5. Sending Ringtones to a 3320 phone trough the IrDA Port
    By djromero in forum Smart Messaging
    Replies: 0
    Last Post: 2002-11-20, 01:51

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