Luanti 5.18.0-dev
Loading...
Searching...
No Matches
internal.h
Go to the documentation of this file.
1// Luanti
2// SPDX-License-Identifier: LGPL-2.1-or-later
3// Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
4
5#pragma once
6
7#include "network/mtp/impl.h"
8
9#include "util/numeric.h"
10
11// Constant that differentiates the protocol from random data and other protocols
12#define PROTOCOL_ID 0x4f457403
13
14#define MAX_UDP_PEERS 65535
15
16/*
17=== NOTES ===
18
19A packet is sent through a channel to a peer with a basic header:
20 Header (7 bytes):
21 [0] u32 protocol_id
22 [4] session_t sender_peer_id
23 [6] u8 channel
24sender_peer_id:
25 Unique to each peer.
26 value 0 (PEER_ID_INEXISTENT) is reserved for making new connections
27 value 1 (PEER_ID_SERVER) is reserved for server
28 these constants are defined in constants.h
29channel:
30 Channel numbers have no intrinsic meaning. Currently only 0, 1, 2 exist.
31*/
32#define BASE_HEADER_SIZE 7
33#define CHANNEL_COUNT 3
34
35/*
36Packet types:
37
38PACKET_TYPE_CONTROL: This is a packet used by the protocol.
39- When this is processed, nothing is handed to the user.
40 Header (2 byte):
41 [0] u8 type
42 [1] u8 controltype
43controltype and data description:
44 CONTROLTYPE_ACK
45 [2] u16 seqnum
46 CONTROLTYPE_SET_PEER_ID
47 [2] session_t peer_id_new
48 CONTROLTYPE_PING
49 - There is no actual reply, but this can be sent in a reliable
50 packet to get a reply
51 CONTROLTYPE_DISCO
52*/
53
54/*
55PACKET_TYPE_ORIGINAL: This is a plain packet with no control and no error
56checking at all.
57- When this is processed, it is directly handed to the user.
58 Header (1 byte):
59 [0] u8 type
60*/
61#define ORIGINAL_HEADER_SIZE 1
62
63/*
64PACKET_TYPE_SPLIT: These are sequences of packets forming one bigger piece of
65data.
66- When processed and all the packet_nums 0...packet_count-1 are
67 present (this should be buffered), the resulting data shall be
68 directly handed to the user.
69- If the data fails to come up in a reasonable time, the buffer shall
70 be silently discarded.
71- These can be sent as-is or atop of a RELIABLE packet stream.
72 Header (7 bytes):
73 [0] u8 type
74 [1] u16 seqnum
75 [3] u16 chunk_count
76 [5] u16 chunk_num
77*/
78
79/*
80PACKET_TYPE_RELIABLE: Delivery of all RELIABLE packets shall be forced by ACKs,
81and they shall be delivered in the same order as sent. This is done
82with a buffer in the receiving and transmitting end.
83- When this is processed, the contents of each packet is recursively
84 processed as packets.
85 Header (3 bytes):
86 [0] u8 type
87 [1] u16 seqnum
88
89*/
90#define RELIABLE_HEADER_SIZE 3
91#define SEQNUM_INITIAL 65500
92#define SEQNUM_MAX 65535
93
94/****/
95
96template<typename T>
98public:
100 ConstSharedPtr(const std::shared_ptr<T> &ptr) : ptr(ptr) {}
101
102 const T* get() const noexcept { return ptr.get(); }
103 const T& operator*() const noexcept { return *ptr.get(); }
104 const T* operator->() const noexcept { return ptr.get(); }
105
106private:
107 std::shared_ptr<T> ptr;
108};
109
110namespace con
111{
112
120
127
128inline bool seqnum_higher(u16 totest, u16 base)
129{
130 if (totest > base)
131 {
132 if ((totest - base) > (SEQNUM_MAX/2))
133 return false;
134
135 return true;
136 }
137
138 if ((base - totest) > (SEQNUM_MAX/2))
139 return true;
140
141 return false;
142}
143
144inline bool seqnum_in_window(u16 seqnum, u16 next,u16 window_size)
145{
146 u16 window_start = next;
147 u16 window_end = ( next + window_size ) % (SEQNUM_MAX+1);
148
149 if (window_start < window_end) {
150 return ((seqnum >= window_start) && (seqnum < window_end));
151 }
152
153
154 return ((seqnum < window_end) || (seqnum >= window_start));
155}
156
157inline float CALC_DTIME(u64 lasttime, u64 curtime)
158{
159 float value = (curtime - lasttime) / 1000.0f;
160 return MYMAX(MYMIN(value, 0.1f), 0.0f);
161}
162
163/* Exceptions */
164
166{
167public:
168 NotFoundException(const char *s) : BaseException(s) {}
169};
170
172{
173public:
175};
176
178{
179public:
180 ProcessedQueued(const char *s) : BaseException(s) {}
181};
182
184{
185public:
187};
188
189
190/*
191 Struct for all kinds of packets. Includes following data:
192 BASE_HEADER
193 u8[] packet data (usually copied from SharedBuffer<u8>)
194*/
196 BufferedPacket(u32 a_size)
197 {
198 m_data.resize(a_size);
199 data = &m_data[0];
200 }
201
203
204 u16 getSeqnum() const;
205 void setSenderPeerId(session_t id);
206
207 inline size_t size() const { return m_data.size(); }
208
209 u8 *data; // Direct memory access
210 float time = 0.0f; // Seconds from buffering the packet or re-sending
211 float totaltime = 0.0f; // Seconds from buffering the packet
214 Address address; // Sender or destination
215
216private:
217 std::vector<u8> m_data; // Data of the packet, including headers
218};
219
220
221// This adds the base headers to the data and makes a packet out of it
222BufferedPacketPtr makePacket(const Address &address, const SharedBuffer<u8> &data,
223 u32 protocol_id, session_t sender_peer_id, u8 channel);
224
225// Depending on size, make a TYPE_ORIGINAL or TYPE_SPLIT packet
226// Increments split_seqnum if a split packet is made
227void makeAutoSplitPacket(const SharedBuffer<u8> &data, u32 chunksize_max,
228 u16 &split_seqnum, std::list<SharedBuffer<u8>> *list);
229
230// Add the TYPE_RELIABLE header to the data
232
234{
235 IncomingSplitPacket(u32 cc, bool r):
236 chunk_count(cc), reliable(r) {}
237
239
240 float time = 0.0f; // Seconds from adding
242 bool reliable; // If true, isn't deleted on timeout
243
244 bool allReceived() const
245 {
246 return (chunks.size() == chunk_count);
247 }
248 bool insert(u32 chunk_num, SharedBuffer<u8> &chunkdata);
250
251private:
252 // Key is chunk number, value is data without headers
253 std::map<u16, SharedBuffer<u8>> chunks;
254};
255
256/*
257 A buffer which stores reliable packets and sorts them internally
258 for fast access to the smallest one.
259*/
260
262{
263public:
264 bool getFirstSeqnum(u16 &result);
265
267 BufferedPacketPtr popSeqnum(u16 seqnum);
268 void insert(BufferedPacketPtr &p_ptr, u16 next_expected);
270 void fixPeerId(session_t id);
271
272 void incrementTimeouts(float dtime);
273 u32 getTimedOuts(float timeout);
274 // timeout relative to last resend
275 std::vector<ConstSharedPtr<BufferedPacket>> getResend(float timeout, u32 max_packets);
276
277 void print();
278 bool empty();
279 u32 size();
280
281
282private:
283 typedef std::list<BufferedPacketPtr>::iterator FindResult;
284
285 FindResult findPacketNoLock(u16 seqnum);
286
287 std::list<BufferedPacketPtr> m_list;
288
290
291 std::mutex m_list_mutex;
292};
293
294/*
295 A buffer for reconstructing split packets
296*/
297
299{
300public:
302
303 /*
304 Returns a reference counted buffer of length != 0 when a full split
305 packet is constructed. If not, returns one of length 0.
306 */
307 SharedBuffer<u8> insert(BufferedPacketPtr &p_ptr, bool reliable);
308
309 void removeUnreliableTimedOuts(float dtime, float timeout);
310
311private:
312 // Key is seqnum
313 std::map<u16, IncomingSplitPacket*> m_buf;
314
315 std::mutex m_map_mutex;
316};
317
330
331// This is very similar to ConnectionEvent
359
360/*
361 * Window sizes to use, in packets (not bytes!).
362 * 0xFFFF is theoretical maximum. don't think about
363 * touching it, the less you're away from it the more likely data corruption
364 * will occur
365 *
366 * Note: window sizes directly translate to maximum possible throughput, e.g.
367 * (2048 * 512 bytes) / 33ms = 15 MiB/s
368 */
369
370// Due to backwards compatibility we have different window sizes for what we'll
371// accept from peers vs. what we use for sending.
372#define MAX_RELIABLE_WINDOW_SIZE 0x8000
373#define MAX_RELIABLE_WINDOW_SIZE_SEND 2048
374/* starting value for window size */
375#define START_RELIABLE_WINDOW_SIZE 64
376/* minimum value for window size */
377#define MIN_RELIABLE_WINDOW_SIZE 32
378
380{
381
382public:
385
386 u16 getOutgoingSequenceNumber(bool& successful);
388 bool putBackSequenceNumber(u16);
389
391 void setNextSplitSeqNum(u16 seqnum);
392
393 // This is for buffering the incoming packets that are coming in
394 // the wrong order
396 // This is for buffering the sent packets so that the sender can
397 // re-send them if no ACK is received
399
400 //queued reliable packets
401 std::queue<BufferedPacketPtr> queued_reliables;
402
403 //queue commands prior splitting to packets
404 std::deque<ConnectionCommandPtr> queued_commands;
405
407
408 Channel() = default;
409 ~Channel() = default;
410
411 void UpdatePacketLossCounter(unsigned int count);
413 void UpdateBytesSent(unsigned int bytes,unsigned int packages=1);
414 void UpdateBytesLost(unsigned int bytes);
415 void UpdateBytesReceived(unsigned int bytes);
416
417 void UpdateTimers(float dtime);
418
423
428
433
440
441 u16 getWindowSize() const { return m_window_size; };
442
447
448private:
451
453
456
457 unsigned int current_packet_loss = 0;
458 unsigned int current_packet_too_late = 0;
461
462 unsigned int current_bytes_transfered = 0;
463 unsigned int current_bytes_received = 0;
464 unsigned int current_bytes_lost = 0;
465 float max_kbps = 0.0f;
466 float cur_kbps = 0.0f;
467 float avg_kbps = 0.0f;
468 float max_incoming_kbps = 0.0f;
469 float cur_incoming_kbps = 0.0f;
470 float avg_incoming_kbps = 0.0f;
471 float max_kbps_lost = 0.0f;
472 float cur_kbps_lost = 0.0f;
473 float avg_kbps_lost = 0.0f;
474 float bpm_counter = 0.0f;
475
476 unsigned int rate_samples = 0;
477};
478
479
480class UDPPeer final : public Peer
481{
482public:
483
484 friend class PeerHelper;
487 friend class Connection;
488
489 UDPPeer(session_t id, const Address &address, Connection *connection);
490 virtual ~UDPPeer() = default;
491
493 unsigned int max_packet_size) override;
494
495 virtual const Address &getAddress() const override {
496 return address;
497 }
498
499 u16 getNextSplitSequenceNumber(u8 channel) override;
500 void setNextSplitSequenceNumber(u8 channel, u16 seqnum) override;
501
503 bool reliable) override;
504
505 bool isTimedOut(float timeout, std::string &reason) override;
506
507protected:
508 /*
509 Calculates avg_rtt and resend_timeout.
510 rtt=-1 only recalculates resend_timeout
511 */
512 void reportRTT(float rtt) override;
513
514 void RunCommandQueues(
515 unsigned int max_packet_size,
516 unsigned int maxtransfer);
517
520
521 void setResendTimeout(float timeout)
523
524 bool Ping(float dtime, SharedBuffer<u8>& data) override;
525
528private:
529 // This is changed dynamically
530 float resend_timeout = 0.5;
531
534 unsigned int max_packet_size);
535};
536
537}
#define DISABLE_CLASS_COPY(C)
Definition basic_macros.h:26
#define MYMIN(a, b)
Definition basic_macros.h:9
#define MYMAX(a, b)
Definition basic_macros.h:11
Definition address.h:27
BaseException(const std::string &s) noexcept
Definition exceptions.h:14
Definition pointer.h:15
const T * operator->() const noexcept
Definition internal.h:104
const T & operator*() const noexcept
Definition internal.h:103
ConstSharedPtr(T *ptr)
Definition internal.h:99
std::shared_ptr< T > ptr
Definition internal.h:107
const T * get() const noexcept
Definition internal.h:102
ConstSharedPtr(const std::shared_ptr< T > &ptr)
Definition internal.h:100
Definition networkpacket.h:16
Definition pointer.h:132
Definition internal.h:380
void UpdateBytesLost(unsigned int bytes)
Definition impl.cpp:713
u16 getOutgoingSequenceNumber(bool &successful)
Definition impl.cpp:646
u16 m_window_size
Definition internal.h:450
unsigned int current_packet_loss
Definition internal.h:457
void UpdatePacketTooLateCounter()
Definition impl.cpp:726
float getAvgLossRateKB()
Definition internal.h:436
u16 readNextIncomingSeqNum()
Definition impl.cpp:621
float getCurrentLossRateKB()
Definition internal.h:424
float cur_incoming_kbps
Definition internal.h:469
void UpdateTimers(float dtime)
Definition impl.cpp:732
u16 getWindowSize() const
Definition internal.h:441
u16 next_outgoing_split_seqnum
Definition internal.h:455
unsigned int current_packet_too_late
Definition internal.h:458
float bpm_counter
Definition internal.h:474
float avg_incoming_kbps
Definition internal.h:470
float getMaxLossRateKB()
Definition internal.h:426
unsigned int current_packet_successful
Definition internal.h:459
float max_kbps
Definition internal.h:465
float max_incoming_kbps
Definition internal.h:468
float getAvgIncomingRateKB()
Definition internal.h:438
ReliablePacketBuffer outgoing_reliables_sent
Definition internal.h:398
~Channel()=default
float getAvgDownloadRateKB()
Definition internal.h:434
std::deque< ConnectionCommandPtr > queued_commands
Definition internal.h:404
float getMaxIncomingRateKB()
Definition internal.h:431
void UpdateBytesSent(unsigned int bytes, unsigned int packages=1)
Definition impl.cpp:701
float avg_kbps_lost
Definition internal.h:473
u16 incNextIncomingSeqNum()
Definition impl.cpp:627
bool putBackSequenceNumber(u16)
Definition impl.cpp:691
void UpdateBytesReceived(unsigned int bytes)
Definition impl.cpp:708
ReliablePacketBuffer incoming_reliables
Definition internal.h:395
float packet_loss_counter
Definition internal.h:460
u16 readNextSplitSeqNum()
Definition impl.cpp:635
float max_kbps_lost
Definition internal.h:471
u16 next_incoming_seqnum
Definition internal.h:452
unsigned int current_bytes_transfered
Definition internal.h:462
float avg_kbps
Definition internal.h:467
void setWindowSize(long size)
Definition internal.h:443
IncomingSplitBuffer incoming_splits
Definition internal.h:406
unsigned int current_bytes_lost
Definition internal.h:464
void UpdatePacketLossCounter(unsigned int count)
Definition impl.cpp:720
float getCurrentDownloadRateKB()
Definition internal.h:419
std::mutex m_internal_mutex
Definition internal.h:449
float getMaxDownloadRateKB()
Definition internal.h:421
float getCurrentIncomingRateKB()
Definition internal.h:429
void setNextSplitSeqNum(u16 seqnum)
Definition impl.cpp:640
float cur_kbps
Definition internal.h:466
std::queue< BufferedPacketPtr > queued_reliables
Definition internal.h:401
u16 next_outgoing_seqnum
Definition internal.h:454
unsigned int current_bytes_received
Definition internal.h:463
u16 readOutgoingSequenceNumber()
Definition impl.cpp:685
float cur_kbps_lost
Definition internal.h:472
Channel()=default
unsigned int rate_samples
Definition internal.h:476
IncomingDataCorruption(const char *s)
Definition internal.h:186
Definition internal.h:299
std::mutex m_map_mutex
Definition internal.h:315
std::map< u16, IncomingSplitPacket * > m_buf
Definition internal.h:313
SharedBuffer< u8 > insert(BufferedPacketPtr &p_ptr, bool reliable)
Definition impl.cpp:451
void removeUnreliableTimedOuts(float dtime, float timeout)
Definition impl.cpp:518
~IncomingSplitBuffer()
Definition impl.cpp:443
NotFoundException(const char *s)
Definition internal.h:168
Peer(session_t id, const Address &address, Connection *connection)
Definition impl.h:159
Address address
Definition impl.h:183
std::mutex m_exclusive_access_mutex
Definition impl.h:176
ProcessedQueued(const char *s)
Definition internal.h:180
ProcessedSilentlyException(const char *s)
Definition internal.h:174
Definition internal.h:262
void incrementTimeouts(float dtime)
Definition impl.cpp:353
std::list< BufferedPacketPtr >::iterator FindResult
Definition internal.h:283
u16 m_oldest_non_answered_ack
Definition internal.h:289
BufferedPacketPtr popSeqnum(u16 seqnum)
Definition impl.cpp:221
u32 size()
Definition impl.cpp:180
std::vector< ConstSharedPtr< BufferedPacket > > getResend(float timeout, u32 max_packets)
Definition impl.cpp:374
void fixPeerId(session_t id)
Adjusts the sender peer ID for all packets.
Definition impl.cpp:346
std::mutex m_list_mutex
Definition internal.h:291
BufferedPacketPtr popFirst()
Definition impl.cpp:204
bool empty()
Definition impl.cpp:174
std::list< BufferedPacketPtr > m_list
Definition internal.h:287
void print()
Definition impl.cpp:163
u32 getTimedOuts(float timeout)
Definition impl.cpp:362
void insert(BufferedPacketPtr &p_ptr, u16 next_expected)
Definition impl.cpp:242
FindResult findPacketNoLock(u16 seqnum)
Definition impl.cpp:186
bool getFirstSeqnum(u16 &result)
Definition impl.cpp:195
bool processReliableSendCommand(ConnectionCommandPtr &c_ptr, unsigned int max_packet_size)
Definition impl.cpp:1064
void setNextSplitSequenceNumber(u8 channel, u16 seqnum) override
Definition impl.cpp:1205
void RunCommandQueues(unsigned int max_packet_size, unsigned int maxtransfer)
Definition impl.cpp:1167
friend class ConnectionReceiveThread
Definition internal.h:485
void reportRTT(float rtt) override
Definition impl.cpp:994
friend class Connection
Definition internal.h:487
bool isTimedOut(float timeout, std::string &reason) override
Definition impl.cpp:976
friend class PeerHelper
Definition internal.h:484
void PutReliableSendCommand(ConnectionCommandPtr &c, unsigned int max_packet_size) override
Definition impl.cpp:1033
UDPPeer(session_t id, const Address &address, Connection *connection)
Definition impl.cpp:969
bool m_pending_disconnect
Definition internal.h:527
Channel channels[CHANNEL_COUNT]
Definition internal.h:526
float resend_timeout
Definition internal.h:530
virtual const Address & getAddress() const override
Definition internal.h:495
u16 getNextSplitSequenceNumber(u8 channel) override
Definition impl.cpp:1199
virtual ~UDPPeer()=default
void setResendTimeout(float timeout)
Definition internal.h:521
friend class ConnectionSendThread
Definition internal.h:486
float getResendTimeout()
Definition internal.h:518
bool Ping(float dtime, SharedBuffer< u8 > &data) override
Definition impl.cpp:1019
SharedBuffer< u8 > addSplitPacket(u8 channel, BufferedPacketPtr &toadd, bool reliable) override
Definition impl.cpp:1211
#define PEER_ID_INEXISTENT
Definition constants.h:19
#define MAX_RELIABLE_WINDOW_SIZE_SEND
Definition internal.h:373
#define SEQNUM_MAX
Definition internal.h:92
#define CHANNEL_COUNT
Definition internal.h:33
#define MIN_RELIABLE_WINDOW_SIZE
Definition internal.h:377
#define SEQNUM_INITIAL
Definition internal.h:91
std::lock_guard< std::mutex > MutexAutoLock
Definition mutex_auto_lock.h:31
Definition client.h:64
ControlType
Definition internal.h:121
@ CONTROLTYPE_DISCO
Definition internal.h:125
@ CONTROLTYPE_PING
Definition internal.h:124
@ CONTROLTYPE_ACK
Definition internal.h:122
@ CONTROLTYPE_SET_PEER_ID
Definition internal.h:123
bool seqnum_in_window(u16 seqnum, u16 next, u16 window_size)
Definition internal.h:144
SharedBuffer< u8 > makeReliablePacket(const SharedBuffer< u8 > &data, u16 seqnum)
Definition impl.cpp:145
PacketType
Definition internal.h:113
@ PACKET_TYPE_CONTROL
Definition internal.h:114
@ PACKET_TYPE_RELIABLE
Definition internal.h:117
@ PACKET_TYPE_MAX
Definition internal.h:118
@ PACKET_TYPE_SPLIT
Definition internal.h:116
@ PACKET_TYPE_ORIGINAL
Definition internal.h:115
void makeAutoSplitPacket(const SharedBuffer< u8 > &data, u32 chunksize_max, u16 &split_seqnum, std::list< SharedBuffer< u8 > > *list)
Definition impl.cpp:131
ConnectionCommandType
Definition internal.h:318
@ CONNCMD_RESEND_ONE
Definition internal.h:327
@ CONNCMD_CONNECT
Definition internal.h:320
@ CONNCMD_PEER_ID_SET
Definition internal.h:328
@ CONNCMD_SEND
Definition internal.h:323
@ CONNCMD_DISCONNECT_PEER
Definition internal.h:322
@ CONNCMD_SEND_TO_ALL
Definition internal.h:324
@ CONNCMD_NONE
Definition internal.h:319
@ CONCMD_CREATE_PEER
Definition internal.h:326
@ CONNCMD_DISCONNECT
Definition internal.h:321
@ CONCMD_ACK
Definition internal.h:325
std::shared_ptr< BufferedPacket > BufferedPacketPtr
Definition impl.h:89
float CALC_DTIME(u64 lasttime, u64 curtime)
Definition internal.h:157
std::shared_ptr< ConnectionCommand > ConnectionCommandPtr
Definition impl.h:86
BufferedPacketPtr makePacket(const Address &address, const SharedBuffer< u8 > &data, u32 protocol_id, session_t sender_peer_id, u8 channel)
Definition impl.cpp:62
bool seqnum_higher(u16 totest, u16 base)
Definition internal.h:128
u16 session_t
Definition networkprotocol.h:27
constexpr T rangelim(const T &d, const T2 &min, const T3 &max)
Definition numeric.h:20
Definition internal.h:195
u8 * data
Definition internal.h:209
Address address
Definition internal.h:214
void setSenderPeerId(session_t id)
Definition impl.cpp:53
size_t size() const
Definition internal.h:207
u64 absolute_send_time
Definition internal.h:212
float time
Definition internal.h:210
std::vector< u8 > m_data
Definition internal.h:217
u16 getSeqnum() const
Definition impl.cpp:45
float totaltime
Definition internal.h:211
BufferedPacket(u32 a_size)
Definition internal.h:196
u32 resend_count
Definition internal.h:213
static ConnectionCommandPtr connect(Address address)
Definition impl.cpp:550
static ConnectionCommandPtr ack(session_t peer_id, u8 channelnum, const Buffer< u8 > &data)
Definition impl.cpp:596
static ConnectionCommandPtr create(ConnectionCommandType type)
Definition impl.cpp:545
static ConnectionCommandPtr disconnect_peer(session_t peer_id)
Definition impl.cpp:562
u8 channelnum
Definition internal.h:337
static ConnectionCommandPtr createPeer(session_t peer_id, const Buffer< u8 > &data)
Definition impl.cpp:606
Buffer< u8 > data
Definition internal.h:338
static ConnectionCommandPtr peer_id_set(session_t own_peer_id)
Definition impl.cpp:578
Address address
Definition internal.h:335
bool reliable
Definition internal.h:339
ConnectionCommand(ConnectionCommandType type_)
Definition internal.h:354
static ConnectionCommandPtr disconnect()
Definition impl.cpp:557
bool raw
Definition internal.h:340
static ConnectionCommandPtr send(session_t peer_id, u8 channelnum, NetworkPacket *pkt, bool reliable)
Definition impl.cpp:585
session_t peer_id
Definition internal.h:336
const ConnectionCommandType type
Definition internal.h:334
static ConnectionCommandPtr resend_one(session_t peer_id)
Definition impl.cpp:569
DISABLE_CLASS_COPY(ConnectionCommand)
u32 chunk_count
Definition internal.h:241
bool allReceived() const
Definition internal.h:244
SharedBuffer< u8 > reassemble()
Definition impl.cpp:417
IncomingSplitPacket(u32 cc, bool r)
Definition internal.h:235
bool reliable
Definition internal.h:242
bool insert(u32 chunk_num, SharedBuffer< u8 > &chunkdata)
Definition impl.cpp:401
std::map< u16, SharedBuffer< u8 > > chunks
Definition internal.h:253
float time
Definition internal.h:240