#pragma once #include #include #include #include class OscQueryHttpServer { public: // Binds TCP on 127.0.0.1:0 (ephemeral). oscUdpPort is reflected in HOST_INFO. // Returns the assigned TCP port, or 0 on failure. uint16_t Start(uint16_t oscUdpPort, const char* serviceName); void StopAndJoin(); private: void AcceptLoop(); uintptr_t m_listenSock{(uintptr_t)-1}; // SOCKET; using uintptr_t to avoid winsock2 in header std::thread m_thread; std::atomic m_stop{false}; std::string m_rootJson; std::string m_hostInfoJson; uint16_t m_tcpPort{0}; };