Initial commit
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
#include "BroadcastClientImpl.h"
|
||||
#include "BroadcastClient.h"
|
||||
|
||||
|
||||
namespace Network {
|
||||
|
||||
BroadcastClient::BroadcastClient(const std::string& listenAddress, int broadcastPort, std::function<void(const std::string&)> callback) :
|
||||
m_pBroadcastClientImpl(new BroadcastClientImpl(listenAddress, broadcastPort, callback))
|
||||
{
|
||||
}
|
||||
|
||||
BroadcastClient::~BroadcastClient() = default;
|
||||
|
||||
void BroadcastClient::Receive()
|
||||
{
|
||||
m_pBroadcastClientImpl->Receive();
|
||||
}
|
||||
|
||||
std::string BroadcastClient::Send(const std::string& data, int sourcePort)
|
||||
{
|
||||
return m_pBroadcastClientImpl->Send(data, sourcePort);
|
||||
}
|
||||
|
||||
void BroadcastClient::Broadcast(const std::string& data, int sourcePort)
|
||||
{
|
||||
m_pBroadcastClientImpl->Broadcast(data, sourcePort);
|
||||
}
|
||||
|
||||
} // namespace Network
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
#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
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
#include "IcmpClientImpl.h"
|
||||
#include "IcmpClient.h"
|
||||
|
||||
|
||||
namespace Network {
|
||||
|
||||
IcmpClient::IcmpClient() :
|
||||
m_pIcmpClientImpl(new IcmpClientImpl())
|
||||
{
|
||||
}
|
||||
|
||||
IcmpClient::~IcmpClient() = default;
|
||||
|
||||
bool IcmpClient::Ping(const std::string& targetAddress)
|
||||
{
|
||||
return m_pIcmpClientImpl->Ping(targetAddress);
|
||||
}
|
||||
|
||||
} // namespace Network
|
||||
|
||||
Symlink
+1
@@ -0,0 +1 @@
|
||||
../Makefile
|
||||
@@ -0,0 +1,30 @@
|
||||
#include "MulticastClientImpl.h"
|
||||
#include "MulticastClient.h"
|
||||
|
||||
|
||||
namespace Network {
|
||||
|
||||
MulticastClient::MulticastClient(const std::string& listenAddress, const std::string& multicastAddress, int multicastPort, std::function<void(const std::string&)> callback) :
|
||||
m_pMulticastClientImpl(new MulticastClientImpl(listenAddress, multicastAddress, multicastPort, callback))
|
||||
{
|
||||
}
|
||||
|
||||
MulticastClient::~MulticastClient() = default;
|
||||
|
||||
void MulticastClient::Receive()
|
||||
{
|
||||
m_pMulticastClientImpl->Receive();
|
||||
}
|
||||
|
||||
std::string MulticastClient::Send(const std::string& data, int sourcePort)
|
||||
{
|
||||
return m_pMulticastClientImpl->Send(data, sourcePort);
|
||||
}
|
||||
|
||||
void MulticastClient::Broadcast(const std::string& data, int sourcePort)
|
||||
{
|
||||
m_pMulticastClientImpl->Broadcast(data, sourcePort);
|
||||
}
|
||||
|
||||
} // namespace Network
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
#include "UdpClientImpl.h"
|
||||
#include "UdpClient.h"
|
||||
|
||||
|
||||
namespace Network {
|
||||
|
||||
UdpClient::UdpClient(const std::string& listenAddress, const std::string& targetAddress, int targetPort, std::function<void(const std::string&)> callback) :
|
||||
m_pUdpClientImpl(new UdpClientImpl(listenAddress, targetAddress, targetPort, callback))
|
||||
{
|
||||
}
|
||||
|
||||
UdpClient::~UdpClient() = default;
|
||||
|
||||
void UdpClient::Receive()
|
||||
{
|
||||
m_pUdpClientImpl->Receive();
|
||||
}
|
||||
|
||||
std::string UdpClient::Send(const std::string& data, int sourcePort)
|
||||
{
|
||||
return m_pUdpClientImpl->Send(data, sourcePort);
|
||||
}
|
||||
|
||||
void UdpClient::Broadcast(const std::string& data, int sourcePort)
|
||||
{
|
||||
m_pUdpClientImpl->Broadcast(data, sourcePort);
|
||||
}
|
||||
|
||||
} // namespace Network
|
||||
|
||||
Reference in New Issue
Block a user