| 1234567891011121314151617181920212223242526272829303132 |
- #ifndef BROADCASTSERVER_H
- #define BROADCASTSERVER_H
- #include <functional>
- #include <memory>
- #include <string>
- namespace Network {
- class BroadcastServerImpl;
- class BroadcastServer
- {
- public:
- BroadcastServer(const std::string& listenAddress, int broadcastPort, std::function<void(const std::string&)> callback);
- ~BroadcastServer();
- public:
- void Receive();
- std::string Send(const std::string& data, int sourcePort = 0);
- void Broadcast(const std::string& data, int sourcePort = 0);
- private:
- std::unique_ptr<BroadcastServerImpl> m_pBroadcastServerImpl;
- };
- } // namespace Network
- #endif // BROADCASTSERVER_H
|