yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::cli::api::BonjourPublisher Class Reference

#include <bonjour_publisher.h>

Public Member Functions

 BonjourPublisher ()=default
 
 ~BonjourPublisher ()
 
void Publish (int port, const std::string &rom_title="")
 Start advertising. Call after the HTTP server socket is bound.
 
void Unpublish ()
 Stop advertising. Safe to call multiple times.
 
bool IsPublished () const
 
bool IsAvailable () const
 

Private Attributes

bool published_ = false
 

Detailed Description

Publishes a _yaze._tcp. Bonjour service so iOS clients on the LAN can discover this desktop instance automatically.

Definition at line 16 of file bonjour_publisher.h.

Constructor & Destructor Documentation

◆ BonjourPublisher()

yaze::cli::api::BonjourPublisher::BonjourPublisher ( )
default

◆ ~BonjourPublisher()

yaze::cli::api::BonjourPublisher::~BonjourPublisher ( )

Definition at line 13 of file bonjour_publisher.cc.

References Unpublish().

Here is the call graph for this function:

Member Function Documentation

◆ Publish()

void yaze::cli::api::BonjourPublisher::Publish ( int port,
const std::string & rom_title = "" )

Start advertising. Call after the HTTP server socket is bound.

Definition at line 17 of file bonjour_publisher.cc.

References LOG_ERROR, LOG_INFO, and published_.

Referenced by yaze::cli::api::HttpServer::Start().

◆ Unpublish()

void yaze::cli::api::BonjourPublisher::Unpublish ( )

Stop advertising. Safe to call multiple times.

Definition at line 66 of file bonjour_publisher.cc.

References LOG_INFO, and published_.

Referenced by yaze::cli::api::HttpServer::Stop(), and ~BonjourPublisher().

◆ IsPublished()

bool yaze::cli::api::BonjourPublisher::IsPublished ( ) const
inline

Definition at line 27 of file bonjour_publisher.h.

References published_.

Referenced by yaze::cli::api::HttpServer::Start().

◆ IsAvailable()

bool yaze::cli::api::BonjourPublisher::IsAvailable ( ) const
inline

Returns true on macOS where Bonjour (dns_sd) is natively available, false on all other platforms.

Definition at line 31 of file bonjour_publisher.h.

Referenced by yaze::cli::api::HandleHealth(), and yaze::cli::api::HttpServer::Start().

Member Data Documentation

◆ published_

bool yaze::cli::api::BonjourPublisher::published_ = false
private

Definition at line 40 of file bonjour_publisher.h.

Referenced by IsPublished(), Publish(), and Unpublish().


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