Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::events::InterprocessConnectionServer Class Reference

Interprocess connection server — listens for multiple client connections. More...

#include <interprocess_connection.hpp>

Public Member Functions

 InterprocessConnectionServer ()
virtual ~InterprocessConnectionServer ()
bool start (std::string_view name, IpcTransport transport=IpcTransport::Socket)
 Start listening on the given name.
void stop ()
 Stop listening and disconnect all clients.
void set_max_message_bytes (std::size_t bytes)
 Apply a framing ceiling to every subsequently accepted connection.
void set_write_timeout (std::chrono::milliseconds timeout)
void set_frame_read_timeout (std::chrono::milliseconds timeout)
bool is_running () const
 Whether the server is running.
std::uint16_t bound_port () const
 Actual TCP port after binding, including an OS-assigned port requested with host:0.
std::string bound_address () const
 Actual bound IPv4 address after binding (e.g.
virtual void client_connected (std::unique_ptr< InterprocessConnection > connection)
 Called when a new client connects.
 InterprocessConnectionServer (const InterprocessConnectionServer &)=delete
InterprocessConnectionServer & operator= (const InterprocessConnectionServer &)=delete

Public Attributes

std::function< void(std::unique_ptr< InterprocessConnection >)> on_client_connected
 Lambda callback alternative.

Detailed Description

Interprocess connection server — listens for multiple client connections.

Each accepted connection gets its own InterprocessConnection.

Constructor & Destructor Documentation

◆ InterprocessConnectionServer() [1/2]

pulp::events::InterprocessConnectionServer::InterprocessConnectionServer ( )

◆ ~InterprocessConnectionServer()

virtual pulp::events::InterprocessConnectionServer::~InterprocessConnectionServer ( )
virtual

◆ InterprocessConnectionServer() [2/2]

pulp::events::InterprocessConnectionServer::InterprocessConnectionServer ( const InterprocessConnectionServer & )
delete

Member Function Documentation

◆ bound_address()

std::string pulp::events::InterprocessConnectionServer::bound_address ( ) const

Actual bound IPv4 address after binding (e.g.

"127.0.0.1" or "0.0.0.0"). Returns empty for local, pipe, or unbound servers.

◆ bound_port()

std::uint16_t pulp::events::InterprocessConnectionServer::bound_port ( ) const

Actual TCP port after binding, including an OS-assigned port requested with host:0.

Returns zero for local, pipe, or unbound servers.

◆ client_connected()

virtual void pulp::events::InterprocessConnectionServer::client_connected ( std::unique_ptr< InterprocessConnection > connection)
virtual

Called when a new client connects.

Override to handle. The returned connection is owned by the server.

◆ is_running()

bool pulp::events::InterprocessConnectionServer::is_running ( ) const
inline

Whether the server is running.

◆ operator=()

InterprocessConnectionServer & pulp::events::InterprocessConnectionServer::operator= ( const InterprocessConnectionServer & )
delete

◆ set_frame_read_timeout()

void pulp::events::InterprocessConnectionServer::set_frame_read_timeout ( std::chrono::milliseconds timeout)

◆ set_max_message_bytes()

void pulp::events::InterprocessConnectionServer::set_max_message_bytes ( std::size_t bytes)

Apply a framing ceiling to every subsequently accepted connection.

◆ set_write_timeout()

void pulp::events::InterprocessConnectionServer::set_write_timeout ( std::chrono::milliseconds timeout)

◆ start()

bool pulp::events::InterprocessConnectionServer::start ( std::string_view name,
IpcTransport transport = IpcTransport::Socket )

Start listening on the given name.

For sockets an omitted host ("9100") listens on 127.0.0.1 only; pass "0.0.0.0:9100" explicitly to accept connections from other hosts.

◆ stop()

void pulp::events::InterprocessConnectionServer::stop ( )

Stop listening and disconnect all clients.

Member Data Documentation

◆ on_client_connected

std::function<void(std::unique_ptr<InterprocessConnection>)> pulp::events::InterprocessConnectionServer::on_client_connected

Lambda callback alternative.


The documentation for this class was generated from the following file: