yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
bonjour_publisher.h
Go to the documentation of this file.
1#ifndef YAZE_SRC_CLI_SERVICE_API_BONJOUR_PUBLISHER_H_
2#define YAZE_SRC_CLI_SERVICE_API_BONJOUR_PUBLISHER_H_
3
4#include <string>
5
6#ifdef __APPLE__
7#include <dns_sd.h>
8#endif
9
10namespace yaze {
11namespace cli {
12namespace api {
13
17 public:
18 BonjourPublisher() = default;
20
22 void Publish(int port, const std::string& rom_title = "");
23
25 void Unpublish();
26
27 bool IsPublished() const { return published_; }
28
31 bool IsAvailable() const {
32#ifdef __APPLE__
33 return true;
34#else
35 return false;
36#endif
37 }
38
39 private:
40 bool published_ = false;
41#ifdef __APPLE__
42 DNSServiceRef service_ref_ = nullptr;
43#endif
44};
45
46} // namespace api
47} // namespace cli
48} // namespace yaze
49
50#endif // YAZE_SRC_CLI_SERVICE_API_BONJOUR_PUBLISHER_H_
void Unpublish()
Stop advertising. Safe to call multiple times.
void Publish(int port, const std::string &rom_title="")
Start advertising. Call after the HTTP server socket is bound.