Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QTcpSocket - Connection Refused Error
Qt 6.11 is out! See what's new in the release blog

QTcpSocket - Connection Refused Error

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 8.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Alegen
    wrote on last edited by
    #1

    Hello!

    I have just started a bit of socket programming and decided to learn it with Qt. Now, what I am trying to do is connect to localhost but every time i get the "Connection Refused" error.

    Have also tried it with my firewall turned off but still the same thing. Can anyone tell me some reasons for this?

    Thanks in advance

    << something smart >>
    (signatures always contain something like that)

    1 Reply Last reply
    0
    • G Offline
      G Offline
      giesbert
      wrote on last edited by
      #2

      You try to connect what?
      Do you have a server process listening on the port you try to connect?
      How did you do it?

      If you provide a small code snippet, it could help us analyzing your problem...

      Nokia Certified Qt Specialist.
      Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Alegen
        wrote on last edited by
        #3

        Sorry... my knowledge of socket programming is so low that (stupidly) I didn`t know there had to be a server listening to the port also... the connection works now, made a fast server to listen to the port and the connections is made...

        Thanks for the swift reply. Gonna go read some more on this network programming :(

        << something smart >>
        (signatures always contain something like that)

        1 Reply Last reply
        0
        • G Offline
          G Offline
          giesbert
          wrote on last edited by
          #4

          I suggest looking at these examples: "network examples":http://doc.qt.nokia.com/4.7/examples-network.html

          The "loopback example":http://doc.qt.nokia.com/4.7/network-loopback.html shows how to communicate between server and client on localhost

          Nokia Certified Qt Specialist.
          Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved