×

Discussion Board

Results 1 to 11 of 11
  1. #1
    Registered User
    Join Date
    Oct 2008
    Posts
    229

    Question socket accept error

    Hi,
    Everyone!

    I got a problem:socket accept error

    exec the below

    Code:
    iListenSckt.Accept( iDataSckt, iStatus );
    the emulator exit!

    I guess that:the iDataSckt didn't connected


    Because I hava no right to upload attachment,I put my code on the mail in the Drafts,
    the subject is "socket accept error",please download the attachment and give me a hand,thank you very much!

    www.gmail.com
    usr: opensymbian@gmail.com
    pwd: ilovesymbian

    I use s60 3rd FP2 SDK.

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

    Re: socket accept error

    Have you already done the usual steps as:
    - enabling panic codes (http://wiki.forum.nokia.com/index.ph...ded_panic_code)
    - checking "last words" of the emulator in its log (http://wiki.forum.nokia.com/index.php/Epocwind.out) ?
    Note that if you are starting your executable directly (so not via its icon in the emulator), it is normal that the whole emulator shuts down when your code panics (more about this topic: http://wiki.forum.nokia.com/index.ph...arbide.c%2B%2B).

  3. #3
    Registered User
    Join Date
    Oct 2008
    Posts
    229

    Unhappy Re: socket accept error

    wizard_hu_,thank you very much!

    I had to do according to your.

    but the emulator can not catch the panic, the Epocwind.out "last words" is:

    13.415 Thread Console::Console Panic ESock_client 7
    13.415 TeUtl: ECN.HandleCallBack.<
    13.415 TeUtl: ECN.DoHandleCallBack.<
    13.415 TeUtl: ECN.DoHandleCallBack.>
    13.415 TeUtl: ECN.HandleCallBack.>
    13.415 WSOCK: ServProvider: [0D4659FC] Shutdown(00000003)
    13.415 WSOCK: ServProvider: [0D4659FC] destroyed
    13.415 WSOCK: ServProvider: [0D46516C] Shutdown(00000003)
    13.415 WSOCK: ServProvider: [0D46516C] destroyed


    I also find below messages in Epocwind.out:
    12.900 *PlatSec* WARNING - Capability check would have failed - A Message (function number=0x00000006) from Thread Console[edb84009]0001::Console, sent to Server !ecomserver, was checked by Thread ecomserver.EXE[10009d8f]0001::!ecomserver and was found to be missing the capabilities: TCB . Additional diagnostic message: ECOM: Client (edb84009) may not access plugin implementation (101fd65a_v1)
    12.900 *PlatSec* WARNING - Capability check would have failed - Process Console[edb84009]0001 can't load Z:\sys\bin\avkonfep.dll because the following capabilities are missing: TCB
    12.900 *PlatSec* WARNING - Capability check would have failed - A Message (function number=0x00000002) from Thread Console[edb84009]0001::Console, sent to Server !ecomserver, was checked by Thread ecomserver.EXE[10009d8f]0001::!ecomserver and was found to be missing the capabilities: TCB . Additional diagnostic message: ECOM: Client (edb84009) may not access plugin implementation (10285839_v1)
    12.900 *PlatSec* WARNING - Capability check would have failed - A Message (function number=0x00000006) from Thread Console[edb84009]0001::Console, sent to Server !ecomserver, was checked by Thread ecomserver.EXE[10009d8f]0001::!ecomserver and was found to be missing the capabilities: TCB . Additional diagnostic message: ECOM: Client (edb84009) may not access plugin implementation (10285839_v1)
    12.905 *PlatSec* WARNING - Capability check would have failed - Process Console[edb84009]0001 can't load Z:\sys\bin\aknfepuiavkonplugin.dll because the following capabilities are missing: TCB



    I add all capability to mmp file,but it doesn't work!


    I write a socketengine inherit from CActive,

    when exec this code "iListenSckt.Accept( iDataSckt, iStatus );"

    the socket iDataSckt didn't connect ok and the emulator exit.


    Please check my code and give me a hand,very very thanks!

    www.gmail.com
    usr: opensymbian@gmail.com
    pwd: ilovesymbian

  4. #4
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,683

    Re: socket accept error

    The emulator+debugger can catch the panic, if you enable Just In Time debugging in the preferences of the emulator.
    Anyway, if you code is called "Console", you have ESock_client 7 panic:
    13.415 Thread Console::Console Panic ESock_client 7
    That is the one you should fix.
    Do you have any special reason for restricting the accepted inbound connections to your own host? If not, consider forgetting that iAddr-magic (which probably does not work), and replace the Bind with a SetLocalPort.

  5. #5
    Registered User
    Join Date
    Oct 2008
    Posts
    229

    Question Re: socket accept error

    wizard_hu_,thank you very much!

    But what's the "ESock_client 7 panic"?


    I have a few days to solve this "socket accept error" problem,
    However, no progress has been made,I'm really urgent.


    Please give me a hand, very thanks!

  6. #6
    Super Contributor
    Join Date
    Oct 2007
    Location
    જુનાગઢ - India
    Posts
    3,034

    Re: socket accept error

    Also *PlatSec* WARNING says "following capabilities are missing: TCB", And if you are using TCB then you have to sign your appliaction with symbian signing, because developer/open signed certificate will not work with Manufacturer-approved capabilities.

  7. #7
    Registered User
    Join Date
    Oct 2008
    Posts
    229

    Re: socket accept error

    savaj:
    Thank you very much!


    But I just write a simple application, run it on emulator,
    default, we have all capabilities.


    We also have the "TCB" capability on the emulator?


    That's crazy!

  8. #8
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,683

    Re: socket accept error

    Have you tried SetLocalPort instead of Bind?

  9. #9
    Registered User
    Join Date
    Oct 2008
    Posts
    229

    Unhappy Re: socket accept error

    wizard_hu_, thank you so much!

    I tried SetLocalPort instead of Bind, but it didn't work.

    Code:
    User::LeaveIfError( iListenSckt.Open( iScktServ, KAfInet, KSockStream, KProtocolInetTcp ) ); //User::LeaveIfError( iListenSckt.Bind( iAddr ) ); User::LeaveIfError( iListenSckt.SetLocalPort( 346 ) ); User::LeaveIfError( iListenSckt.Listen( 1 ) ); iListenSckt.Accept( iDataSckt, iStatus );

    when exec the Accept method, the emulator exit.


    Please download my code and find the reason,
    I really have no way to solve this problem, I'm going to crazy!

    Dear friend,thank you so much!

  10. #10
    Super Contributor
    Join Date
    Jul 2007
    Location
    ShenZhen, China
    Posts
    4,346

    Re: socket accept error

    1. because tcp port < 1024 is reserved by system, so normally not use the tcp port, u can try 3456 or other bigger port.

    2. I suggest you that use RConnection class, so the
    User::LeaveIfError( iListenSckt.Open( iScktServ, KAfInet, KSockStream, KProtocolInetTcp )

    change to

    User::LeaveIfError( iListenSckt.Open( iScktServ, KAfInet, KSockStream, KProtocolInetTcp, iConnection ) etc

    3. iDataSckt is which you need open too, so before accept, you need call iDataSckt.Open

    4. make sure that you have CActiveSchedule

    and next is my some code with listen, hope it is help to you
    Code:
    TBool CListenSocket::ListenL()
    {
    	User::LeaveIfError(iListenSocket.Open( *(iIapEngine->GetSocketServ()), KAfInet, KSockStream, 
    	                                        KProtocolInetTcp, *(iIapEngine->GetConnection()) ));
    
        const TInt LISTEN_MIN = 6000;
        const TInt LISTEN_MAX = 7000;
        TUint port = LISTEN_MIN;
        for ( ; port < LISTEN_MAX; port++)
        {
            iListenAddr.SetPort(port);
            if ( iListenSocket.Bind(iListenAddr) == KErrNone )
            {
                break;
            }
        }
        if ( port >= LISTEN_MAX )
        {
            iListenSocket.Close();
            return EFalse;
        }
        
    	iListenSocket.Listen(1);
    	// Create blank socket
    	iAcceptSocket.Open(*(iIapEngine->GetSocketServ()));
    
    	// Issue an accept
    	iListenSocket.Accept(iAcceptSocket, iStatus);
    	SetActive();
    ps. there is chinese discussion board, you can use chinese
    Last edited by qxiaoyuan; 2009-04-07 at 17:07.
    ----------------------------
    坚持学习, 坚持编码
    http://www.devdiv.net/
    qxiaoyuan

  11. #11
    Registered User
    Join Date
    Jul 2009
    Posts
    4

    Re: socket accept error

    You should open blank socket for accept:
    Please try following:

    User::LeaveIfError(iClSocket->Open(iSocketServ));
    iSocket.Accept(*iClSocket, iStatus);

Similar Threads

  1. Replies: 7
    Last Post: 2009-03-21, 18:54
  2. Cannot compile SDK's examples for 7650 platform...
    By midletsoft in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2003-08-12, 19:11
  3. how to avoid linking error
    By skdas in forum Symbian
    Replies: 6
    Last Post: 2003-07-07, 07:57

Posting Permissions

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