Discussion Board

Results 1 to 11 of 11
  1. #1
    Registered User rati2010's Avatar
    Join Date
    Jun 2008
    Posts
    40
    Hi All,

    I am trying to create a socket to raed a chunk of data from the server side.When working on emulator i am able to get the data..but using device it is giving error. I am able to connect
    to the socket and after that only i am requesting the data..
    i am using iSocket.RecvOneOrMore() for getting the data..

    Can anyone please guide what is the problem?

    Thanks

  2. #2
    Super Contributor ivey's Avatar
    Join Date
    Jun 2006
    Location
    Moscow, Russia
    Posts
    803
    What error do you get?

    Also it would be great if you could provide a code snippet illustrating how you are establishing a connection.
    Regards,
    ivey

  3. #3
    Registered User rati2010's Avatar
    Join Date
    Jun 2008
    Posts
    40
    the application is getting exited..

    i am using this for receiving the data
    iSocket.RecvOneOrMore( iBuffer, 0, iStatus, iDummyLength );

    and this code for connection

    TInetAddr addr;
    ConnectL( addr.Address() );

    I am giving appropriate IP address..and have checked that the connection is happening...but only when i try to raed data it is crashing.

  4. #4
    Nokia Developer Moderator wizard_hu_'s Avatar
    Join Date
    Feb 2006
    Location
    Mallorca, Holiday
    Posts
    27,683

  5. #5
    Registered User david.caabeiro's Avatar
    Join Date
    Apr 2005
    Location
    Barcelona
    Posts
    1,678
    With that little bit of info is hard to say. Post at least the lines surrounding your recv call.. and check if you get any panic..

  6. #6
    Super Contributor ivey's Avatar
    Join Date
    Jun 2006
    Location
    Moscow, Russia
    Posts
    803
    Quote Originally Posted by rati2010 View Post
    the application is getting exited..
    Your application panics. Please refer to this article on how to get the panic details: Extended panic code.
    Regards,
    ivey

  7. #7
    Registered User rati2010's Avatar
    Join Date
    Jun 2008
    Posts
    40
    void CReader::RunL()
    {
    RFs rfs;
    RFile aFile ;
    TBuf8<51200> aCon;
    CAknInformationNote* note = new (ELeave)CAknInformationNote(ETrue);
    note->ExecuteLD(_L("RunL")); // Have to be removed
    // Active object request complete handler
    switch ( iStatus.Int() )
    {
    case KErrNone:
    iEngineNotifier.ResponseReceived( iBuffer );
    aCon.Copy(iBuffer);
    TInt err;
    User::LeaveIfError(rfs.Connect());
    err = aFile.Open(rfs,KPath1,EFileWrite);
    if(err != KErrNone)
    err = aFile.Create(rfs,KPath1,EFileWrite);//EFileShareReadersOrWriters);
    if(KErrNone == err)
    {
    int pos = 0;
    aFile.Size(pos);
    aFile.Seek(ESeekStart,pos);
    err = aFile.Write( aCon);
    }
    aFile.Close();
    rfs.Close();

    break;
    case KErrDisconnected:
    iEngineNotifier.ReportError( Notifier::EDisconnected,
    iStatus.Int() );
    break;
    default:
    iEngineNotifier.ReportError( Notifier::EGeneralReadError,
    iStatus.Int() );
    break;
    }
    }



    void CReader::IssueRead()
    {
    CAknInformationNote* note = new (ELeave)CAknInformationNote(ETrue);
    note->ExecuteLD(_L("IssueRead")); // Have to be removed
    // Initiate a new read from socket into iBuffer
    __ASSERT_ALWAYS( !IsActive(), User::Panic( KPanicEngineRead,
    ESocketsBadState ) );
    iSocket.RecvOneOrMore( iBuffer, 0, iStatus, iDummyLength );
    SetActive();
    }




    After IssueRead() (it enters IssueRead function() called from soem other function and i am able to see the information note on entering the IssueRead()),the application exits and shows KernEXec3.. which we are getting when we manually exit the application on the emulator...otherwise it works fine on emulator.
    -

  8. #8
    Super Contributor ivey's Avatar
    Join Date
    Jun 2006
    Location
    Moscow, Russia
    Posts
    803
    Quote Originally Posted by rati2010 View Post
    void CReader::RunL()
    {
    RFs rfs;
    RFile aFile ;
    TBuf8<51200> aCon;
    CAknInformationNote* note = new (ELeave)CAknInformationNote(ETrue);
    note->ExecuteLD(_L("RunL")); // Have to be removed
    // Active object request complete handler
    Well, to begin with you can make the aCon buffer not so large (1 kB or less) or allocate this memory on heap. You are definitely running out of stack here.
    Regards,
    ivey

  9. #9
    Registered User rati2010's Avatar
    Join Date
    Jun 2008
    Posts
    40
    Thanks a lot.. On reducing the size it is working ...

  10. #10
    Super Contributor ivey's Avatar
    Join Date
    Jun 2006
    Location
    Moscow, Russia
    Posts
    803
    Great!

    To avoid such issues in future the following article may be useful for you:
    Emulator/native platform differences
    Regards,
    ivey

  11. #11
    Nokia Developer Moderator wizard_hu_'s Avatar
    Join Date
    Feb 2006
    Location
    Mallorca, Holiday
    Posts
    27,683
    In fact iBuffer is already a 8-bit descriptor, you can write it directly to the file.

Similar Threads

  1. DATA STREAM from socket to bluetooth
    By mariobid in forum Mobile Java Networking & Messaging & Security
    Replies: 2
    Last Post: 2007-07-15, 06:17
  2. Closing bluetooth socket AFTER all data has been sent
    By tumppi in forum Symbian Networking & Messaging (Closed)
    Replies: 2
    Last Post: 2007-07-09, 13:28
  3. Read from a secure socket always returns data
    By barnabyg in forum Mobile Java General
    Replies: 1
    Last Post: 2006-07-02, 20:30
  4. 6600 gprs 发送大量rtp延时问题
    By dicson_hu in forum Symbian
    Replies: 9
    Last Post: 2005-11-04, 02:12
  5. Nokia 6600 Socket Server send delay Problem
    By dicson_hu in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2005-10-31, 07:37

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