21 #ifndef OLAD_OLASERVER_H_
22 #define OLAD_OLASERVER_H_
35 #include "ola/io/SelectServer.h"
36 #include "ola/network/InterfacePicker.h"
37 #include "ola/network/Socket.h"
38 #include "ola/network/TCPSocketFactory.h"
39 #include "ola/plugin_id.h"
46 #ifdef HAVE_LIBMICROHTTPD
47 typedef class OladHTTPServer OladHTTPServer_t;
49 typedef int OladHTTPServer_t;
59 bool http_localhost_only;
60 bool http_enable_quit;
61 unsigned int http_port;
62 std::string http_data_dir;
63 std::string network_interface;
64 std::string pid_data_dir;
68 const std::vector<class PluginLoader*> &plugin_loaders,
80 void ReloadPidStore();
85 void ChannelClosed(ola::io::DescriptorHandle read_descriptor);
86 bool RunHousekeeping();
88 static const unsigned int DEFAULT_HTTP_PORT = 9090;
96 typedef std::map<ola::io::DescriptorHandle, ClientEntry> ClientMap;
98 class OlaClientServiceFactory *m_service_factory;
99 std::vector<class PluginLoader*> m_plugin_loaders;
104 std::auto_ptr<class ExportMap> m_our_export_map;
105 class ExportMap *m_export_map;
106 class PreferencesFactory *m_preferences_factory;
107 class Preferences *m_universe_preferences;
109 std::auto_ptr<class DeviceManager> m_device_manager;
110 std::auto_ptr<class PluginManager> m_plugin_manager;
111 std::auto_ptr<class PluginAdaptor> m_plugin_adaptor;
112 std::auto_ptr<class UniverseStore> m_universe_store;
113 std::auto_ptr<class PortManager> m_port_manager;
114 std::auto_ptr<class OlaServerServiceImpl> m_service_impl;
115 std::auto_ptr<class ClientBroker> m_broker;
116 std::auto_ptr<class PortBroker> m_port_broker;
117 std::auto_ptr<const ola::rdm::RootPidStore> m_pid_store;
119 ola::thread::timeout_id m_housekeeping_timeout;
120 ClientMap m_sd_to_service;
121 std::auto_ptr<OladHTTPServer_t> m_httpd;
122 std::auto_ptr<class DiscoveryAgentInterface> m_discovery_agent;
123 const Options m_options;
126 #ifdef HAVE_LIBMICROHTTPD
131 void CleanupConnection(ClientEntry client);
132 void ReloadPluginsInternal();
135 static const char UNIVERSE_PREFERENCES[];
136 static const char K_CLIENT_VAR[];
137 static const char K_UID_VAR[];
138 static const char K_DISCOVERY_SERVICE_TYPE[];
139 static const unsigned int K_HOUSEKEEPING_TIMEOUT_MS;
144 #endif // OLAD_OLASERVER_H_