Пример #1
0
bool Packet::addPayload(const core::memory::ConstBlob &newData) {
  const size_t newSize = getHeader().m_size + newData.size();
  if (newSize + sizeof(Packet::Header) > PACKET_MAX_SIZE_TCP) {
    return false;
  }

  core::memory::Blob payload = getMutablePayload(newSize);
  memcpy(payload.data() + getHeader().m_size, newData.data(), newData.size());
  getMutableHeader().m_size = newSize;
  return true;
}
Пример #2
0
	Logon() : Message<ProtocolAdaptor>("A"){
		getMutableHeader().setField(35, "A");
	}
Пример #3
0
void Packet::setType(const u16 type) {
  getMutableHeader().m_type = type;
}
Пример #4
0
void Packet::setIndex(const u16 index) {
  getMutableHeader().m_index = index;
}
Пример #5
0
Packet::Packet() {
  getMutableHeader() = Header();
}