Github User Fetcher 1.0.0
C Application with Server and GUI
|
Implements an HTTP server using Boost.Beast and Boost.Asio to serve GitHub user data. More...
#include "server.hpp"
#include "user.hpp"
#include <boost/asio.hpp>
#include <boost/asio/signal_set.hpp>
#include <boost/beast/core.hpp>
#include <boost/beast/http.hpp>
#include <boost/beast/version.hpp>
#include <nlohmann/json.hpp>
#include <iostream>
#include <memory>
#include <string>
#include <thread>
#include <vector>
Go to the source code of this file.
Data Structures | |
class | HttpSession |
Manages a single HTTP session with a client. More... | |
Typedefs | |
using | tcp = net::ip::tcp |
Functions | |
void | start_http_server (int port) |
Starts the HTTP server on the specified port. | |
Implements an HTTP server using Boost.Beast and Boost.Asio to serve GitHub user data.
Definition in file server.cpp.
using tcp = net::ip::tcp |
Definition at line 26 of file server.cpp.
void start_http_server | ( | int | port | ) |
Starts the HTTP server on the specified port.
Starts the HTTP server.
Sets up an io_context
, signal handlers for graceful shutdown, and an asynchronous TCP acceptor to listen for and handle incoming HTTP connections using HttpSession
.
The server runs in a multi-threaded fashion, utilizing all available hardware threads.
port | The port number on which the HTTP server should listen. |
Lambda for accepting incoming connections recursively.
This lambda captures itself and re-issues accept calls until the server is stopped.
Definition at line 130 of file server.cpp.