1 #ifndef BLANK_NET_CONNECTION_HPP_
2 #define BLANK_NET_CONNECTION_HPP_
5 #include "../app/IntervalTimer.hpp"
16 explicit Connection(const IPaddress &);
18 const IPaddress &Address() const noexcept { return addr; }
20 bool Matches(const IPaddress &) const noexcept;
22 bool ShouldPing() const noexcept;
23 bool TimedOut() const noexcept;
25 void Close() noexcept { closed = true; }
26 bool Closed() const noexcept { return closed || TimedOut(); }
30 void SendPing(UDPpacket &, UDPsocket);
32 void Send(UDPpacket &, UDPsocket);
33 void Received(const UDPpacket &);
36 void FlagSend() noexcept;
37 void FlagRecv() noexcept;
41 IntervalTimer send_timer;
42 IntervalTimer recv_timer;
44 Packet::TControl ctrl;