Results 1 to 3 of 3

Thread: Server design questions

  1. #1
    Join Date
    Sep 2008
    Posts
    13
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Server design questions

    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!

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Server design questions

    Obviously, the web server can't connect directly to these clients.
    No, but the clients can connect to the server and once connected data can flow both ways.

    You planning to write a HTTP proxy server, and you don't think you are reinventing the wheel?

  3. #3
    Join Date
    Sep 2008
    Posts
    13
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Server design questions

    Well yes, I thought about proxy servers but what I need it's not that, I need a web server to connect to a program in an user computer, only when a request to the web server is made. Thus, I need the program in the user computer to be available all the time. What a proxy server does is:

    - Receive a request from user.
    - Retrieve the requested data.
    - Send it to the user.

    What I need is:

    - A user loads a web page.
    - The web server requests some data from another user's computer.
    - The web server shows the data to the first user in a web page.

Similar Threads

  1. QScript design questions
    By ctgrund in forum Newbie
    Replies: 4
    Last Post: 24th March 2011, 12:27
  2. Game server design
    By supergillis in forum General Programming
    Replies: 3
    Last Post: 15th June 2010, 15:40
  3. Client-Server software project design question
    By MarkoSan in forum Qt Programming
    Replies: 7
    Last Post: 25th March 2008, 10:31
  4. Client-Server Application design suggestion
    By berzeck in forum Qt Programming
    Replies: 6
    Last Post: 17th December 2007, 19:13
  5. application design questions
    By nikita in forum Qt Programming
    Replies: 6
    Last Post: 28th August 2006, 01:35

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.