Starts, monitors, and shuts down a server process spawned by the client.
More...
#include <HostedServer.hpp>
|
| bool | start (const HostConfigState &config, std::string &outError) |
| | Launch the server executable with the requested hosting options.
|
| void | shutdown () |
| | Stop the locally owned hosted server process.
|
| bool | isRunning () |
| | True if the app still owns a child server process.
|
| uint16_t | port () |
| | Actual server port reported by the child process, or 0 when not running.
|
| bool | hasSession () const |
| | True when this client has launched a hosted session and still knows its port.
|
| void | clearSession () |
| | Forget hosted-session metadata after a confirmed local or remote shutdown.
|
|
| pid_t | childPid = -1 |
| | POSIX child pid for the hosted server, or -1 when none is running.
|
| uint16_t | boundPort = 0 |
| | Port printed by the child server READY line.
|
Starts, monitors, and shuts down a server process spawned by the client.
◆ clearSession()
| void HostedServer::clearSession |
( |
| ) |
|
Forget hosted-session metadata after a confirmed local or remote shutdown.
◆ detachForPersistence()
| void HostedServer::detachForPersistence |
( |
| ) |
|
|
private |
Drop local ownership of a persistent server after successful launch.
◆ hasSession()
| bool HostedServer::hasSession |
( |
| ) |
const |
True when this client has launched a hosted session and still knows its port.
◆ isRunning()
| bool HostedServer::isRunning |
( |
| ) |
|
True if the app still owns a child server process.
◆ port()
| uint16_t HostedServer::port |
( |
| ) |
|
Actual server port reported by the child process, or 0 when not running.
◆ shutdown()
| void HostedServer::shutdown |
( |
| ) |
|
Stop the locally owned hosted server process.
◆ start()
| bool HostedServer::start |
( |
const HostConfigState & | config, |
|
|
std::string & | outError ) |
Launch the server executable with the requested hosting options.
- Parameters
-
| config | Host-screen options, including port and transport mode. |
| outError | Filled with a user-facing error if launch fails. |
- Returns
- True once the child server reports its bound port.
◆ boundPort
| uint16_t HostedServer::boundPort = 0 |
|
private |
Port printed by the child server READY line.
◆ childPid
| pid_t HostedServer::childPid = -1 |
|
private |
POSIX child pid for the hosted server, or -1 when none is running.
The documentation for this class was generated from the following files: