Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Server programming best practises
-
Hi,
I have a desktop app that allow me to interact with a machine. The app works fine but now i want to convert it to a server and replace my UI by a web page.
My app will act like an RPC server.But this is the first time i'm using network with Qt and i'm confused between Low-level, High-level API and WebSocket.
Can someone explain me the difference and tell me what is the best choice in my case ?
Thanks
-
The two most common ways of interaction are SOAP and REST.
For the first one you can use KDSoap library, for the second one you probably need to go lower level
-
Hi @VRonin and thank you for your reply. I will use REST.
Can you tell me what should i use between TcpSocket, Network Access API or WebSocket ?Actually i'm planning to do like in the WebSocket/echoserver example but maybe it is not a good solution.
-
REST runs over http (as far as I remember), so my bet would be
QNetworkAccessManager
and friends.
-
@kshegunov said in Server programming best practises:
so my bet would be QNetworkAccessManager and friends
Yeah, probably the friends part is not trivial as you'd need a web server rather than a web client but googleing quickly popped up a few results
-
@VRonin said in Server programming best practises:
Yeah, probably the friends part is not trivial as you'd need a web server rather than a web client
Ooops, sorry, I was thinking about client side. You're right, it's going to be more involved for the server side ...