Initial commit
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
#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
|
||||
|
||||
Reference in New Issue
Block a user