Hi everyone! I want to write a server program in Qt, and I would like to ask for some advice before I get my hands into coding.
The idea is: there will be clients, running in final user's computers, behind firewalls, routers, etc... I want to be able to communicate with this clients through a web page (send a request and receive a response). Obviously, the web server can't connect directly to these clients.
What I'm planning to do is write a server program, let's call it "proxy"; clients will connect to it and say "Hi! I'm client #X, here is my auth data, validate it and I'll stay connected to you ok?". When a user enters the web and want to retrieve any data from a client, the web server will connect to this "proxy" and send a message like "Tell client #X to send me this data". The "proxy" will send that message to the connected client, wait for the response and send the response back to the web server.
I hope I've been able to explain the idea right. So, here are my questions:
- First of all, is this design correct? Is there anything already out there that does what I need? I don't want to reinvent the wheel
- After reading a lot of posts here about server networking, I'm planning to write it without threads, using the asynchronous socket functions of Qt. Is there any way to know how many clients I can serve with this approach? In case I reach this limit, what should I do? Span another server process using another port, create some threads and divide the clients amog them? Maybe even another machine?
Thanks a lot for your time!
Bookmarks