Initial commit

This commit is contained in:
2020-02-06 08:49:30 +01:00
commit bd4a20b643
18 changed files with 332 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
#ifndef UDPCLIENT_H
#define UDPCLIENT_H
#include <functional>
#include <memory>
#include <string>
namespace Network {
class m_pUdpClientImpl;
class UdpClient
{
public:
UdpClient(const std::string& listenAddress, const std::string& targetAddress, int targetPort, std::function<void(const std::string&)> callback);
~UdpClient();
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<UdpClientImpl> m_pUdpClientImpl;
};
} // namespace Network
#endif // UDPCLIENT_H