MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / Packet

Method Packet

src/network/core/packet.cpp:31–37  ·  view source on GitHub ↗

* Create a packet that is used to read from a network socket. * @param cs The socket handler associated with the socket we are reading from. * @param limit The maximum size of packets to accept. * @param initial_read_size The initial amount of data to transfer from the socket into the * packet. This defaults to just the required bytes to dete

Source from the content-addressed store, hash-verified

29 * size for the packet you expect from the network.
30 */
31Packet::Packet(NetworkSocketHandler *cs, size_t limit, size_t initial_read_size) : pos(0), limit(limit)
32{
33 assert(cs != nullptr);
34
35 this->cs = cs;
36 this->buffer.resize(initial_read_size);
37}
38
39/**
40 * Creates a packet to send

Callers

nothing calls this directly

Calls 4

CanWriteToPacketMethod · 0.95
Send_uint8Method · 0.95
resizeMethod · 0.80
MACSizeMethod · 0.80

Tested by

no test coverage detected