Luanti 5.15.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
213 Address address; // Sender or destination
214 unsigned int resend_count = 0;
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
331
332// This is very similar to ConnectionEvent
361
362/*
363 * Window sizes to use, in packets (not bytes!).
364 * 0xFFFF is theoretical maximum. don't think about
365 * touching it, the less you're away from it the more likely data corruption
366 * will occur
367 *
368 * Note: window sizes directly translate to maximum possible throughput, e.g.
369 * (2048 * 512 bytes) / 33ms = 15 MiB/s
370 */
371
372// Due to backwards compatibility we have different window sizes for what we'll
373// accept from peers vs. what we use for sending.
374#define MAX_RELIABLE_WINDOW_SIZE 0x8000
375#define MAX_RELIABLE_WINDOW_SIZE_SEND 2048
376/* starting value for window size */
377#define START_RELIABLE_WINDOW_SIZE 64
378/* minimum value for window size */
379#define MIN_RELIABLE_WINDOW_SIZE 32
380
382{
383
384public:
387
388 u16 getOutgoingSequenceNumber(bool& successful);
390 bool putBackSequenceNumber(u16);
391
393 void setNextSplitSeqNum(u16 seqnum);
394
395 // This is for buffering the incoming packets that are coming in
396 // the wrong order
398 // This is for buffering the sent packets so that the sender can
399 // re-send them if no ACK is received
401
402 //queued reliable packets
403 std::queue<BufferedPacketPtr> queued_reliables;
404
405 //queue commands prior splitting to packets
406 std::deque<ConnectionCommandPtr> queued_commands;
407
409
410 Channel() = default;
411 ~Channel() = default;
412
413 void UpdatePacketLossCounter(unsigned int count);
415 void UpdateBytesSent(unsigned int bytes,unsigned int packages=1);
416 void UpdateBytesLost(unsigned int bytes);
417 void UpdateBytesReceived(unsigned int bytes);
418
419 void UpdateTimers(float dtime);
420
425
430
435
442
443 u16 getWindowSize() const { return m_window_size; };
444
449
450private:
453
455
458
459 unsigned int current_packet_loss = 0;
460 unsigned int current_packet_too_late = 0;
463
464 unsigned int current_bytes_transfered = 0;
465 unsigned int current_bytes_received = 0;
466 unsigned int current_bytes_lost = 0;
467 float max_kbps = 0.0f;
468 float cur_kbps = 0.0f;
469 float avg_kbps = 0.0f;
470 float max_incoming_kbps = 0.0f;
471 float cur_incoming_kbps = 0.0f;
472 float avg_incoming_kbps = 0.0f;
473 float max_kbps_lost = 0.0f;
474 float cur_kbps_lost = 0.0f;
475 float avg_kbps_lost = 0.0f;
476 float bpm_counter = 0.0f;
477
478 unsigned int rate_samples = 0;
479};
480
481
482class UDPPeer final : public Peer
483{
484public:
485
486 friend class PeerHelper;
489 friend class Connection;
490
491 UDPPeer(session_t id, const Address &address, Connection *connection);
492 virtual ~UDPPeer() = default;
493
495 unsigned int max_packet_size) override;
496
497 virtual const Address &getAddress() const override {
498 return address;
499 }
500
501 u16 getNextSplitSequenceNumber(u8 channel) override;
502 void setNextSplitSequenceNumber(u8 channel, u16 seqnum) override;
503
505 bool reliable) override;
506
507 bool isTimedOut(float timeout, std::string &reason) override;
508
509protected:
510 /*
511 Calculates avg_rtt and resend_timeout.
512 rtt=-1 only recalculates resend_timeout
513 */
514 void reportRTT(float rtt) override;
515
516 void RunCommandQueues(
517 unsigned int max_packet_size,
518 unsigned int maxtransfer);
519
522
523 void setResendTimeout(float timeout)
525
526 bool Ping(float dtime, SharedBuffer<u8>& data) override;
527
530private:
531 // This is changed dynamically
532 float resend_timeout = 0.5;
533
536 unsigned int max_packet_size);
537};
538
539}
#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
Definition exceptions.h:12
Definition pointer.h:15
Definition internal.h:97
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:382
void UpdateBytesLost(unsigned int bytes)
Definition impl.cpp:720
u16 getOutgoingSequenceNumber(bool &successful)
Definition impl.cpp:653
u16 m_window_size
Definition internal.h:452
unsigned int current_packet_loss
Definition internal.h:459
void UpdatePacketTooLateCounter()
Definition impl.cpp:733
float getAvgLossRateKB()
Definition internal.h:438
u16 readNextIncomingSeqNum()
Definition impl.cpp:628
float getCurrentLossRateKB()
Definition internal.h:426
float cur_incoming_kbps
Definition internal.h:471
void UpdateTimers(float dtime)
Definition impl.cpp:739
u16 getWindowSize() const
Definition internal.h:443
u16 next_outgoing_split_seqnum
Definition internal.h:457
unsigned int current_packet_too_late
Definition internal.h:460
float bpm_counter
Definition internal.h:476
float avg_incoming_kbps
Definition internal.h:472
float getMaxLossRateKB()
Definition internal.h:428
unsigned int current_packet_successful
Definition internal.h:461
float max_kbps
Definition internal.h:467
float max_incoming_kbps
Definition internal.h:470
float getAvgIncomingRateKB()
Definition internal.h:440
ReliablePacketBuffer outgoing_reliables_sent
Definition internal.h:400
~Channel()=default
float getAvgDownloadRateKB()
Definition internal.h:436
std::deque< ConnectionCommandPtr > queued_commands
Definition internal.h:406
float getMaxIncomingRateKB()
Definition internal.h:433
void UpdateBytesSent(unsigned int bytes, unsigned int packages=1)
Definition impl.cpp:708
float avg_kbps_lost
Definition internal.h:475
u16 incNextIncomingSeqNum()
Definition impl.cpp:634
bool putBackSequenceNumber(u16)
Definition impl.cpp:698
void UpdateBytesReceived(unsigned int bytes)
Definition impl.cpp:715
ReliablePacketBuffer incoming_reliables
Definition internal.h:397
float packet_loss_counter
Definition internal.h:462
u16 readNextSplitSeqNum()
Definition impl.cpp:642
float max_kbps_lost
Definition internal.h:473
u16 next_incoming_seqnum
Definition internal.h:454
unsigned int current_bytes_transfered
Definition internal.h:464
float avg_kbps
Definition internal.h:469
void setWindowSize(long size)
Definition internal.h:445
IncomingSplitBuffer incoming_splits
Definition internal.h:408
unsigned int current_bytes_lost
Definition internal.h:466
void UpdatePacketLossCounter(unsigned int count)
Definition impl.cpp:727
float getCurrentDownloadRateKB()
Definition internal.h:421
std::mutex m_internal_mutex
Definition internal.h:451
float getMaxDownloadRateKB()
Definition internal.h:423
float getCurrentIncomingRateKB()
Definition internal.h:431
void setNextSplitSeqNum(u16 seqnum)
Definition impl.cpp:647
float cur_kbps
Definition internal.h:468
std::queue< BufferedPacketPtr > queued_reliables
Definition internal.h:403
u16 next_outgoing_seqnum
Definition internal.h:456
unsigned int current_bytes_received
Definition internal.h:465
u16 readOutgoingSequenceNumber()
Definition impl.cpp:692
float cur_kbps_lost
Definition internal.h:474
Channel()=default
unsigned int rate_samples
Definition internal.h:478
Definition threads.h:100
Definition threads.h:41
Definition impl.h:224
Definition internal.h:184
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
Definition internal.h:166
NotFoundException(const char *s)
Definition internal.h:168
Definition impl.h:30
Definition impl.h:96
Address address
Definition impl.h:185
std::mutex m_exclusive_access_mutex
Definition impl.h:178
Definition internal.h:178
ProcessedQueued(const char *s)
Definition internal.h:180
Definition internal.h:172
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
Definition internal.h:483
bool processReliableSendCommand(ConnectionCommandPtr &c_ptr, unsigned int max_packet_size)
Definition impl.cpp:1071
void setNextSplitSequenceNumber(u8 channel, u16 seqnum) override
Definition impl.cpp:1212
void RunCommandQueues(unsigned int max_packet_size, unsigned int maxtransfer)
Definition impl.cpp:1174
void reportRTT(float rtt) override
Definition impl.cpp:1001
bool isTimedOut(float timeout, std::string &reason) override
Definition impl.cpp:983
void PutReliableSendCommand(ConnectionCommandPtr &c, unsigned int max_packet_size) override
Definition impl.cpp:1040
UDPPeer(session_t id, const Address &address, Connection *connection)
Definition impl.cpp:976
bool m_pending_disconnect
Definition internal.h:529
Channel channels[CHANNEL_COUNT]
Definition internal.h:528
float resend_timeout
Definition internal.h:532
virtual const Address & getAddress() const override
Definition internal.h:497
u16 getNextSplitSequenceNumber(u8 channel) override
Definition impl.cpp:1206
virtual ~UDPPeer()=default
void setResendTimeout(float timeout)
Definition internal.h:523
float getResendTimeout()
Definition internal.h:520
bool Ping(float dtime, SharedBuffer< u8 > &data) override
Definition impl.cpp:1026
SharedBuffer< u8 > addSplitPacket(u8 channel, BufferedPacketPtr &toadd, bool reliable) override
Definition impl.cpp:1218
#define PEER_ID_INEXISTENT
Definition constants.h:19
#define MAX_RELIABLE_WINDOW_SIZE_SEND
Definition internal.h:375
#define SEQNUM_MAX
Definition internal.h:92
#define CHANNEL_COUNT
Definition internal.h:33
#define MIN_RELIABLE_WINDOW_SIZE
Definition internal.h:379
#define SEQNUM_INITIAL
Definition internal.h:91
std::lock_guard< std::mutex > MutexAutoLock
Definition mutex_auto_lock.h:31
Definition client.h:61
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:328
@ CONNCMD_CONNECT
Definition internal.h:321
@ CONNCMD_PEER_ID_SET
Definition internal.h:329
@ CONNCMD_SEND
Definition internal.h:324
@ CONNCMD_SERVE
Definition internal.h:320
@ CONNCMD_DISCONNECT_PEER
Definition internal.h:323
@ CONNCMD_SEND_TO_ALL
Definition internal.h:325
@ CONNCMD_NONE
Definition internal.h:319
@ CONCMD_CREATE_PEER
Definition internal.h:327
@ CONNCMD_DISCONNECT
Definition internal.h:322
@ CONCMD_ACK
Definition internal.h:326
std::shared_ptr< BufferedPacket > BufferedPacketPtr
Definition impl.h:91
float CALC_DTIME(u64 lasttime, u64 curtime)
Definition internal.h:157
std::shared_ptr< ConnectionCommand > ConnectionCommandPtr
Definition impl.h:88
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:213
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
unsigned int resend_count
Definition internal.h:214
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
Definition internal.h:334
static ConnectionCommandPtr connect(Address address)
Definition impl.cpp:557
static ConnectionCommandPtr ack(session_t peer_id, u8 channelnum, const Buffer< u8 > &data)
Definition impl.cpp:603
static ConnectionCommandPtr create(ConnectionCommandType type)
Definition impl.cpp:545
static ConnectionCommandPtr disconnect_peer(session_t peer_id)
Definition impl.cpp:569
u8 channelnum
Definition internal.h:338
static ConnectionCommandPtr createPeer(session_t peer_id, const Buffer< u8 > &data)
Definition impl.cpp:613
Buffer< u8 > data
Definition internal.h:339
static ConnectionCommandPtr peer_id_set(session_t own_peer_id)
Definition impl.cpp:585
Address address
Definition internal.h:336
bool reliable
Definition internal.h:340
ConnectionCommand(ConnectionCommandType type_)
Definition internal.h:356
static ConnectionCommandPtr disconnect()
Definition impl.cpp:564
bool raw
Definition internal.h:341
static ConnectionCommandPtr send(session_t peer_id, u8 channelnum, NetworkPacket *pkt, bool reliable)
Definition impl.cpp:592
session_t peer_id
Definition internal.h:337
const ConnectionCommandType type
Definition internal.h:335
static ConnectionCommandPtr resend_one(session_t peer_id)
Definition impl.cpp:576
DISABLE_CLASS_COPY(ConnectionCommand)
static ConnectionCommandPtr serve(Address address)
Definition impl.cpp:550
Definition internal.h:234
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