Pros and cons of using Qnetwork vs sockets
-
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?
-
@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.
-
@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.
@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
-
Hi,
One thing for QTcpSocket, it is asynchronous as the rest of Qt so easier to integrate in your application.
-
Hi,
One thing for QTcpSocket, it is asynchronous as the rest of Qt so easier to integrate in your application.
@SGaist Does this mean I would not have to use threading?
-
You should not need to.