×

Discussion Board

Results 1 to 11 of 11
  1. #1
    Registered User
    Join Date
    Jun 2007
    Posts
    50

    Appl Not responding when I use Sockets

    I am trying to implement TCP sockets in my application, so that our server can push messages to my mobile phone using this sockets. When I execute connect statement to connect to a socket at application server side, I'm able to receive responses. (and I can able to work with the data dynamically.)

    But when I tried to select "Options" menu (Using left soft key), It is not opening (sometimes it is taking 2 min. to open). What might be the reason for this one. This is the code I used in my application.

    void CTcpSocket::RunL()
    {
    Receive();
    iTimer.After(iStatus,1000000);
    SetActive();
    }

    void CTcpSocket::Receive()
    {
    iSocket.RecvOneOrMore(iBuffer,0,iSStatus,iLen);
    User::WaitForRequest(iSStatus);

    if(iSStatus == KErrNone)
    {
    iRecvBuffer.Copy(iBuffer);
    iSynfoTab->dataReceive(iRecvBuffer);
    iRecvBuffer.Zero();
    }
    }

    Please help me out.

  2. #2
    Registered User
    Join Date
    Jun 2007
    Posts
    50

    Re: Appl Not responding when I use Sockets

    In the above code I used the code iSynfoTab->dataReceive(iRecvBuffer); to display the received messages on the display screen. Nothing more than that.

  3. #3
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,165

    Re: Appl Not responding when I use Sockets

    I would go and implement the receiving with Active object to get rid of the WaitForRequest(), which can indeed block your application.

  4. #4
    Registered User
    Join Date
    Jun 2007
    Posts
    50

    Re: Appl Not responding when I use Sockets

    OK Sure. What will happen if I remove the statement WaitForRequest()? Still I'm calling that method at some particular timer interval. Does it make any sense?

  5. #5
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,165

    Re: Appl Not responding when I use Sockets

    Maybe you should read about the Active objects, there should be quite good amount of documents on the subject.

  6. #6
    Registered User
    Join Date
    Jun 2007
    Posts
    50

    Re: Appl Not responding when I use Sockets

    If Active Objects are asynchronous and the requesting functions of Active Object does not block after issuing a request, why the "Options" menu is not working. If it is asynchronous it should support it. Right? Or anything wrong with my understanding.

  7. #7
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,165

    Re: Appl Not responding when I use Sockets

    that because you are not using Active objects correctly, but you are blocking your thread by calling WaitForRequest().

  8. #8
    Registered User
    Join Date
    Jun 2007
    Posts
    50

    Re: Appl Not responding when I use Sockets

    could you please help me out in identifying the problem. where exactly I need to change the code.

  9. #9
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,165

    Re: Appl Not responding when I use Sockets

    Remove the WaitForRequest() and implement it as normal Active object, so please do a bit of searching on documents for Active objects and you'll get it working better.

  10. #10
    Registered User
    Join Date
    Jun 2007
    Posts
    50

    Re: Appl Not responding when I use Sockets

    If I remove WaitForRequest() method it is able to process single packet arrival, and after it is terminating. I tried it by setting iStatus value to KRequestPending, still the same problem. What are the alternatives for this WaitForRequest().

  11. #11
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,737

    Re: Appl Not responding when I use Sockets

    SetActive is the "alternative". You might consider learning about Active Objects, check post #9 and #10 in http://discussion.forum.nokia.com/fo...d.php?t=133649

Similar Threads

  1. How to synchronous RecvFrom() from 2 UDP sockets in an application?
    By lss0986 in forum Symbian Networking & Messaging (Closed)
    Replies: 2
    Last Post: 2007-04-12, 17:57
  2. Using sockets in the fullduplex example
    By niranjancsc in forum Symbian Media (Closed)
    Replies: 1
    Last Post: 2007-03-22, 12:52
  3. Replies: 2
    Last Post: 2006-12-26, 19:57
  4. Where to find application that uses sockets?
    By doctordwarf in forum Mobile Java General
    Replies: 1
    Last Post: 2004-03-10, 15:45
  5. WAP Buffering / Sockets / Http / GPRS
    By Ian Johnson in forum Mobile Java Networking & Messaging & Security
    Replies: 0
    Last Post: 2003-04-11, 13:54

Posting Permissions

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