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 ConnectToHost()
Forum Updated to NodeBB v4.3 + New Features

QTcpSocket ConnectToHost()

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 203 Views
  • 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.
  • V Offline
    V Offline
    Vanius211
    wrote on last edited by
    #1

    I need to connect by ethernet to a generator using tcp/ip. I know it’s ip address only, I already tried basically used port like 80, I have tried to find its port using netstat and telnet but its error when I am trying to connect in the qt app, I also tried to find port in app, using qDebug when one of ports 1-65535 was opened.
    App return like 8 different ports, but when I try to write data it says that socket is not connected
    P.s. sorry for bad english

    JonBJ 1 Reply Last reply
    0
    • V Vanius211

      I need to connect by ethernet to a generator using tcp/ip. I know it’s ip address only, I already tried basically used port like 80, I have tried to find its port using netstat and telnet but its error when I am trying to connect in the qt app, I also tried to find port in app, using qDebug when one of ports 1-65535 was opened.
      App return like 8 different ports, but when I try to write data it says that socket is not connected
      P.s. sorry for bad english

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @Vanius211
      To connect to a host you must know what port number it is listening on. It's no use "guessing" it might be port 80. How can you have something you want to connect to without knowing its port number?

      If you can get it working with telnet on a port you should be able to do same from Qt.

      V 1 Reply Last reply
      0
      • JonBJ JonB

        @Vanius211
        To connect to a host you must know what port number it is listening on. It's no use "guessing" it might be port 80. How can you have something you want to connect to without knowing its port number?

        If you can get it working with telnet on a port you should be able to do same from Qt.

        V Offline
        V Offline
        Vanius211
        wrote on last edited by
        #3

        @JonB ok, thank you! I will check my program, maybe I do something wrong and there is the problem, not because I use incorrect port

        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