Packet

Encompasses an ENetPacket with an object-oriented wrapper. Once a packet has been sent, the data cannot be modified.

Constructors

this
this(ENet enet, const(void)* data, size_t dataLength, uint flags)

Creates an ENetPacket internally.

this
this(ENet enet, ENetPacket* packet)

A convenience constructor for an already existing ENetPacket.

this
this(ENet enet, T data, uint flags)

A convenience constructor for array data.

this
this(ENet enet, T data, uint flags)

A convenience constructor for scalar data.

Destructor

~this
~this()
Undocumented in source.

Members

Functions

close
void close()

Cleans up the internal ENetPacket.

data
ubyte[] data()

Gets the ENetPacket's data.

resize
void resize(size_t dataLength)

Resizes the ENetPacket.

setData
void setData(ubyte[] data)

Sets the ENetPacket's data.

setUserData
void setUserData(void* newData)

Sets application private data.

size
size_t size()

Gets the size of the ENetPacket in bytes.

userData
void* userData()

Gets application private data.

Variables

_destroyed
bool _destroyed;
Undocumented in source.
_dirty
bool _dirty;
Undocumented in source.
_enet
ENet _enet;
Undocumented in source.
_handle
ENetPacket* _handle;
Undocumented in source.

Meta