Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. Pros and cons of using Qnetwork vs sockets

Pros and cons of using Qnetwork vs sockets

Scheduled Pinned Locked Moved Unsolved Qt for Python
6 Posts 3 Posters 625 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.
  • D Offline
    D Offline
    deleted256
    wrote on last edited by
    #1

    I want to create a client server application using pyqt5. Not sure whether to use Qnetwork / QTcpSocket or the default sockets module with python.

    I've found tutorials online using each method but haven't found any information on which is best?

    1 Reply Last reply
    0
    • eyllanescE Offline
      eyllanescE Offline
      eyllanesc
      wrote on last edited by
      #2

      @benyeyeye In summary: QTcpSocket and the classes that handle sockets in python are ultimately handlers of the sockets created by the OS, that is, there are no Qt-sockets or python-sockets, but each technology creates a wrapper over the native sockets of each OS. So you can use any in a general case. So by not giving any particular requirement the answer is: Anyone.

      If you want me to help you develop some work then you can write to my email: e.yllanescucho@gmal.com.

      D 1 Reply Last reply
      0
      • eyllanescE eyllanesc

        @benyeyeye In summary: QTcpSocket and the classes that handle sockets in python are ultimately handlers of the sockets created by the OS, that is, there are no Qt-sockets or python-sockets, but each technology creates a wrapper over the native sockets of each OS. So you can use any in a general case. So by not giving any particular requirement the answer is: Anyone.

        D Offline
        D Offline
        deleted256
        wrote on last edited by
        #3

        @eyllanesc Okay. Would you reccomend one or the other? (e.g if one is easier to set up / has better documentation). I have no experience with either

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi,

          One thing for QTcpSocket, it is asynchronous as the rest of Qt so easier to integrate in your application.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          D 1 Reply Last reply
          1
          • SGaistS SGaist

            Hi,

            One thing for QTcpSocket, it is asynchronous as the rest of Qt so easier to integrate in your application.

            D Offline
            D Offline
            deleted256
            wrote on last edited by
            #5

            @SGaist Does this mean I would not have to use threading?

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              You should not need to.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              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