×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Feb 2005
    Posts
    23

    Why KErrCouldNotConnect again n again ?

    I am trying to connect to remote host but always get the same error KErrCouldNotConnect. Can some1 explain me the reason.
    and tell me the correct solution. My code for connecting to remote host is:-


    RSocketServ aServer;
    User::LeaveIfError( aServer.Connect() );

    RSocket rSocket;
    TInt x = rSocket.Open(aServer, KAfInet,
    KSockStream, KProtocolInetTcp);

    if ( x == KErrNone )
    {
    iEikonEnv->InfoMsg(_L(" There is an Error"));
    }

    TInetAddr addr(INET_ADDR(127,0,0,1),9800);

    TRequestStatus aStatus;
    rSocket.Connect(addr, aStatus ) ;

    User::WaitForRequest(aStatus);
    switch(aStatus.Int())
    {
    case KErrNone:
    iEikonEnv->InfoMsg(_L("Successfully completed a MUX connect"));
    break;

    case KErrNotFound:
    iEikonEnv->InfoMsg(_L("No devices were discovered"));
    break;

    case KErrTimedOut:
    iEikonEnv->InfoMsg(_L("LAP connect has failed ####"));
    break;

    case KErrCouldNotConnect:
    iEikonEnv->InfoMsg(_L("=-Error 34,Could not Connect=-"));
    break;

    case KErrDisconnected:
    iEikonEnv->InfoMsg(_L("General disconnect indication ####"));
    break;

    default:
    iEikonEnv->InfoMsg(_L("UnKnown Connect Error"));
    break;


    }


    I will be gr8ful for any of the help.
    Regargs,
    Ibraheem

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166
    have you checked that there is no firewall preventing you from connecting to the server from your mobile network ?

    yucca

  3. #3
    Regular Contributor
    Join Date
    Jan 2004
    Posts
    128

    Unhappy Re: Why KErrCouldNotConnect again n again ?

    Was it a configuration problem like a wrong port number or something like that? Or was it anything more serious?

    I have experiemrnted that from time to time I got that error in my sockets applications. However, when this problem appears I am not able to open the socket. Sometimes I have also to reset the phone. Howeve, that doesnt ensure that the sockets will be able to connect next time after reinstalling the application.



    Thanks,

    Fernando

  4. #4
    Registered User
    Join Date
    Dec 2005
    Posts
    17

    Re: Why KErrCouldNotConnect again n again ?

    I've also had this problem, although only when connecting to the loopback address (127.0.0.1).

  5. #5
    Registered User
    Join Date
    Jan 2005
    Posts
    391

    Re: Why KErrCouldNotConnect again n again ?

    KErrCouldNotConnect when connect to (127.0.0.1) 1234 port on n95 device (for PushRegistry)
    on emulator this connection is ok!

Posting Permissions

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