#pragma once #ifdef _WIN32 #define NOMINMAX #include #include #include #include #define CLOSESOCK closesocket #define inet_ntop InetNtopA typedef unsigned int uint32_t; typedef unsigned short uint16_t; typedef int socklen_t; typedef SOCKET socket_t; namespace std { // forward declare promise as C++/CLI doesn't allow usage in header files template class future; } // namespace std #else #include #include #include #include #include #include #include #define CLOSESOCK close typedef int socket_t; #include #endif namespace VW { class SpanningTree { private: bool m_stop; socket_t sock; uint16_t m_port; // future to signal end of thread running. // Need a pointer since C++/CLI doesn't like futures yet std::future* m_future; bool m_quiet; public: SpanningTree(short unsigned int port = 26543, bool quiet = false); ~SpanningTree(); short unsigned int BoundPort(); void Start(); void Run(); void Stop(); }; } // namespace VW