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. Listen to Http server by QTcpSocket

Listen to Http server by QTcpSocket

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 1.4k 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.
  • thamT Offline
    thamT Offline
    tham
    wrote on last edited by tham
    #1

    Could I listen to http sever by QTcpSocket?I have use QNetworkAccessManager to download resource from http server, but never tried to listen to the server, any examples/suggestions about this?

    Could I just call

    socket_->connectToHost(ip_address, port);
    

    To listen the messages send from the server?If this work, do it have any drawback? Any pitfalls I should notice? Thanks

    1 Reply Last reply
    0
    • m.sueM Offline
      m.sueM Offline
      m.sue
      wrote on last edited by
      #2

      Hi @tham

      there are the famous fortune telling examples:

      Server: http://doc.qt.io/qt-5/qtnetwork-fortuneserver-example.html
      Client: http://doc.qt.io/qt-5/qtnetwork-fortuneclient-example.html

      -Michael.

      thamT 1 Reply Last reply
      3
      • m.sueM m.sue

        Hi @tham

        there are the famous fortune telling examples:

        Server: http://doc.qt.io/qt-5/qtnetwork-fortuneserver-example.html
        Client: http://doc.qt.io/qt-5/qtnetwork-fortuneclient-example.html

        -Michael.

        thamT Offline
        thamT Offline
        tham
        wrote on last edited by
        #3

        @m.sue It works for http server too?

        m.sueM 1 Reply Last reply
        0
        • thamT tham

          @m.sue It works for http server too?

          m.sueM Offline
          m.sueM Offline
          m.sue
          wrote on last edited by
          #4

          Hi @tham

          Yes. I use it e.g. to download files.

          -Michael.

          1 Reply Last reply
          2

          • Login

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