×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    May 2009
    Posts
    5

    Qt socket error when trying to connect to host

    Hello!

    I'm having a problem with a QTcpSocket.
    Whenever a call to socket->connectToHost("hostname", port) happens, I receive an error QAbstractSocket::HostNotFound.

    While the host is certainly available - I have no problems when launching the same Qt app on my PC.

    Another issue is that my phone doesn't ask me about internet access point when it tries to connect.
    Do I need some special code for that?

    For now I'm just starting a native web browser and navigate to some webpage - to bring connection up.
    Then I start my app and try to connect - and get the error everytime.

    Or is the internet connection used on a per-app basis in Symbian? I'm a symbian noob, so maybe I don't know something

    Any help is appreciated, thanks

    (Using qt-4.5.0-garden and SDK 5th edition)

  2. #2
    Registered User
    Join Date
    May 2009
    Posts
    5

    Re: Qt socket error when trying to connect to host

    In case anyone wondering - I found the solution by asking guys on qts60-feedback@trolltech.com.

    Turned out my executable missed some runtime capabilities which needed to be specified in .pro file:

    TARGET = <appname>
    TARGET.CAPABILITY += NetworkServices

  3. #3
    Regular Contributor
    Join Date
    Jul 2007
    Location
    Dublin
    Posts
    240

    Re: Qt socket error when trying to connect to host

    I think this is root cause problem for all host not found threads in DiBo.

  4. #4
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: Qt socket error when trying to connect to host

    In other threads people say about bug in OpenC, rather than missing capabilities.

  5. #5
    Regular Contributor
    Join Date
    Jul 2007
    Location
    Dublin
    Posts
    240

    Re: Qt socket error when trying to connect to host

    Even I used to get same error in device HttpConsole, After adding NetworkServices things are working fine.
    Last edited by datha_k; 2010-07-25 at 12:31.

Similar Threads

  1. why socket connect function return 13(EACCES)/* Permission denied */
    By bigbencat in forum Symbian Networking & Messaging (Closed)
    Replies: 2
    Last Post: 2007-09-21, 02:46
  2. Socket not resolve host
    By D|3-H4rD in forum Mobile Java Networking & Messaging & Security
    Replies: 4
    Last Post: 2006-09-05, 14:37
  3. sdk 2.6 unable to connect to local host
    By hakimah in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2006-06-26, 02:17
  4. sdk 2.1 emulator able to connect to the net but not to the local host
    By sjsahu in forum Symbian Networking & Messaging (Closed)
    Replies: 15
    Last Post: 2006-02-10, 11:02
  5. Socket Connect never returns error
    By delipsingh in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2005-05-14, 02:08

Posting Permissions

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