* Get the number of bytes in the packet. * When sending a packet this is the size of the data up to that moment. * When receiving a packet (before PrepareToRead) this is the allocated size for the data to be read. * When reading a packet (after PrepareToRead) this is the full size of the packet. * @return The packet's size. */
| 248 | * @return The packet's size. |
| 249 | */ |
| 250 | size_t Packet::Size() const |
| 251 | { |
| 252 | return this->buffer.size(); |
| 253 | } |
| 254 | |
| 255 | /** |
| 256 | * Reads the packet size from the raw packet and stores it in the packet->size |