31 lines
730 B
C++
31 lines
730 B
C++
#include "BroadcastServerImpl.h"
|
|
#include "BroadcastServer.h"
|
|
|
|
|
|
namespace Network {
|
|
|
|
BroadcastServer::BroadcastServer(const std::string& listenAddress, int broadcastPort, std::function<void(const std::string&)> callback) :
|
|
m_pBroadcastServerImpl(new BroadcastServerImpl(listenAddress, broadcastPort, callback))
|
|
{
|
|
}
|
|
|
|
BroadcastServer::~BroadcastServer() = default;
|
|
|
|
void BroadcastServer::Receive()
|
|
{
|
|
m_pBroadcastServerImpl->Receive();
|
|
}
|
|
|
|
std::string BroadcastServer::Send(const std::string& data, int sourcePort)
|
|
{
|
|
return m_pBroadcastServerImpl->Send(data, sourcePort);
|
|
}
|
|
|
|
void BroadcastServer::Broadcast(const std::string& data, int sourcePort)
|
|
{
|
|
m_pBroadcastServerImpl->Broadcast(data, sourcePort);
|
|
}
|
|
|
|
} // namespace Network
|
|
|