1er commit
This commit is contained in:
29
include/network/UDPSocket.h
Normal file
29
include/network/UDPSocket.h
Normal file
@@ -0,0 +1,29 @@
|
||||
#ifndef NETWORK_UDP_SOCKET_H_
|
||||
#define NETWORK_UDP_SOCKET_H_
|
||||
|
||||
#include "network/IPAddress.h"
|
||||
#include "network/Socket.h"
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace td {
|
||||
namespace network {
|
||||
|
||||
class UDPSocket : public Socket {
|
||||
private:
|
||||
IPAddress m_RemoteIP;
|
||||
uint16_t m_Port;
|
||||
sockaddr_in m_RemoteAddr;
|
||||
|
||||
public:
|
||||
UDPSocket();
|
||||
|
||||
bool Connect(const IPAddress& address, std::uint16_t port);
|
||||
std::size_t Send(const std::uint8_t* data, std::size_t size);
|
||||
DataBuffer Receive(std::size_t amount);
|
||||
};
|
||||
|
||||
} // ns network
|
||||
} // ns td
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user