https://github.com/zaki-x86/http-server-examples
Examples of how to create an HTTP server based on Qt framework
https://github.com/zaki-x86/http-server-examples
cpp http-server networking qt5
Last synced: 4 months ago
JSON representation
Examples of how to create an HTTP server based on Qt framework
- Host: GitHub
- URL: https://github.com/zaki-x86/http-server-examples
- Owner: zaki-x86
- Created: 2024-02-07T22:20:41.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-11T00:12:39.000Z (over 2 years ago)
- Last Synced: 2025-03-16T14:40:16.732Z (over 1 year ago)
- Topics: cpp, http-server, networking, qt5
- Language: C++
- Homepage:
- Size: 16.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# http-server-examples
Examples of how to create an HTTP server based on Qt framework
Presented 2 types of servers; single-threaded (blocking) and multi-threaded (non-blocking). Besides, other classes that are necessary to create a server, such as: `Request`, `Response`, and `QTcpServer` wrapper.
For simplicity - and also because we are only looking for results in these examples; The servers should echo back information about the request that they received - there are no fancy request handlers. Once you get the idea, you will be able to add your own request handler the way that suits your needs.
## Single-threaded server
The single-threaded server examples handle only one request at a time. Therefore, it doesn't spawn any thread handlers to handle new incoming requests. It blocks requests until the one currently being handled is done.
## Multithreaded server
Unlike the single-threaded server, it handles multiple requests concurrently by using a threadpool, (aka connection pool).
## Shared modules
Both implementations of the server class share commom objects, which are: `Request`, `Response`, `TcpServerWrapper`, and `ConnectionHandler`.
## Future plans
- Single-threaded async server example