Represents a server that can be started, stopped, and restarted.
More...
#include <server.hpp>
|
| Server (std::string listenAddr) |
| Constructs a Server object.
|
|
virtual | ~Server () |
| Destroys the Server object.
|
|
auto | start () -> bool |
| Starts the server on the specified port.
|
|
auto | stop () -> bool |
| Stops the server.
|
|
auto | getListenAddr () const -> std::string |
| Gets the address the server is listening on.
|
|
Represents a server that can be started, stopped, and restarted.
◆ Server()
Server::Server |
( |
std::string | listenAddr | ) |
|
|
explicit |
Constructs a Server object.
- Parameters
-
listenAddr | The address the server will listen on. |
◆ getListenAddr()
auto Server::getListenAddr |
( |
| ) |
const -> std::string |
|
nodiscard |
Gets the address the server is listening on.
- Returns
- The listen address as a string.
◆ start()
auto Server::start |
( |
| ) |
-> bool |
Starts the server on the specified port.
- Returns
- True if the server started successfully, false otherwise.
◆ stop()
auto Server::stop |
( |
| ) |
-> bool |
Stops the server.
- Returns
- True if the server stopped successfully, false otherwise.
The documentation for this class was generated from the following file: