6 #include <netinet/in.h>
34 std::string
GetIP()
const;
70 void Send(
const std::string& msg)
const;
76 void Send(
const std::vector<unsigned char>& msg)
const;
82 void UDPSend(
const std::string& msg)
const;
88 void UDPSend(
const std::vector<unsigned char>& msg)
const;
A base class representing a network socket.
void GetIpArray(uint8_t *ip) const
Gets the IP address associated with the socket as an array of bytes.
void Send(const std::string &msg) const
Sends a message over the socket.
void UpdateLastRecievedTime()
Updates the last received time to the current system time.
struct sockaddr_in _address
virtual void WTF_WHY_AM_I_HERE_1337()
Empty virtual function required for static_cast in C++.
std::string GetIP() const
Gets the IP address associated with the socket.
std::string GetSocketType() const
Gets the socket type.
std::chrono::system_clock::time_point _recieved_time
void Close()
Closes the socket.
uint16_t GetPort() const
Gets the port number associated with the socket.
std::string GetAddress() const
Gets the full address (IP:Port) associated with the socket.
void UDPSend(const std::string &msg) const
Sends a UDP message over the socket.
std::chrono::system_clock::time_point GetLastRecievedTime() const
Gets the time when the socket last received data.