mirror of
https://github.com/lubosz/overte.git
synced 2025-04-23 20:54:25 +02:00
Move PACKET_WRITE_ERROR to Packet class
This commit is contained in:
parent
12d5ec89d1
commit
2d86e807b0
2 changed files with 4 additions and 1 deletions
|
@ -11,6 +11,8 @@
|
|||
|
||||
#include "Packet.h"
|
||||
|
||||
const qint64 Packet::PACKET_WRITE_ERROR = -1;
|
||||
|
||||
qint64 Packet::localHeaderSize(PacketType::Value type) {
|
||||
qint64 size = numBytesForArithmeticCodedPacketType(type) + sizeof(PacketVersion) +
|
||||
((SEQUENCE_NUMBERED_PACKETS.contains(type)) ? sizeof(SequenceNumber) : 0);
|
||||
|
@ -208,7 +210,6 @@ void Packet::writeSequenceNumber(SequenceNumber seqNum) {
|
|||
&seqNum, sizeof(seqNum));
|
||||
}
|
||||
|
||||
static const qint64 PACKET_WRITE_ERROR = -1;
|
||||
qint64 Packet::writeData(const char* data, qint64 maxSize) {
|
||||
|
||||
// make sure we have the space required to write this block
|
||||
|
|
|
@ -24,6 +24,8 @@ class Packet : public QIODevice {
|
|||
public:
|
||||
using SequenceNumber = uint16_t;
|
||||
|
||||
static const qint64 PACKET_WRITE_ERROR;
|
||||
|
||||
static std::unique_ptr<Packet> create(PacketType::Value type, qint64 size = -1);
|
||||
static std::unique_ptr<Packet> fromReceivedPacket(std::unique_ptr<char> data, qint64 size, const HifiSockAddr& senderSockAddr);
|
||||
|
||||
|
|
Loading…
Reference in a new issue