Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
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?
eyllanesc last edited by
@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
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.