pairpal
Loading...
Searching...
No Matches
Server Class Reference

Represents a server that can be started, stopped, and restarted. More...

#include <server.hpp>

Public Member Functions

 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.
 

Detailed Description

Represents a server that can be started, stopped, and restarted.

Constructor & Destructor Documentation

◆ Server()

Server::Server ( std::string listenAddr)
explicit

Constructs a Server object.

Parameters
listenAddrThe address the server will listen on.

Member Function Documentation

◆ 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: