Question

I want to make a desktop application (since its supposed to be cross-platform, I've decided to stick with Qt, and I am already familiar with it) which connects to a server. The app is similar in concept to a chat application. I know that there are application servers, however as of now, I'm familiar with web server frameworks such as rails, and am trying out node.js currently.

I wanted to know how should I ask my application(Qt-based) to connect to the server, and the main question is, how should I implement the server? After thinking up of various options, including porting the whole project over to as a web-app, I've decided that the best bet would be to use the app to somehow connect to the node.js server and it will serve the html files which will contain the command for the app. Am I on the right path?

Can this (Qt-app & node.js server communication) be achieved in the way I am thinking? Is it the correct method?

Était-ce utile?

La solution

It is easy to communicate with node.js app by socket. Using node.js to create a Net server (http://nodejs.org/api/net.html), and client use socket to connect to it. In my opinion it is easier to build a server with Node.js than C/C++ and has nice performance.

BTW, I think using node.js as server has gradually become a common solution. And My company have developed a mobile game with pomelo which is a node.js game framework.

For more infomation you can see this article http://www.toptal.com/nodejs/why-the-hell-would-i-use-node-js

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top