[ENet-discuss] Packet flags usage

Benoit Germain bnt.germain at gmail.com
Mon Jun 6 07:27:33 PDT 2011


Hello,

Just wanted to know which packet flag combinations are legal?

Currently  we have

   ENET_PACKET_FLAG_RELIABLE
   ENET_PACKET_FLAG_UNSEQUENCED
   ENET_PACKET_FLAG_NO_ALLOCATE
   ENET_PACKET_FLAG_UNRELIABLE_FRAGMENT

I suppose that ENET_PACKET_FLAG_NO_ALLOCATE is a bit different, since
it is specified at packet creation, not when packet is sent.
But regarding the 3 other flags, the doc ENetPacket doc says: "... The
flags field is either 0 (specifying no flags), or a bitwise-or of any
combination of the following flags".
However, I have difficulty imagining what I get when using
ENET_PACKET_FLAG_RELIABLE + ENET_PACKET_FLAG_UNRELIABLE_FRAGMENT.
It also says that ENET_PACKET_FLAG_UNSEQUENCED is not supported for
ENET_PACKET_FLAG_RELIABLE.

So, all in all, it looks like we can have 4 or 5 legal combinations:

ENET_PACKET_FLAG_RELIABLE

ENET_PACKET_FLAG_UNSEQUENCED

ENET_PACKET_FLAG_UNRELIABLE_FRAGMENT

ENET_PACKET_FLAG_UNSEQUENCED + ENET_PACKET_FLAG_UNRELIABLE_FRAGMENT

ENET_PACKET_FLAG_RELIABLE + ENET_PACKET_FLAG_UNRELIABLE_FRAGMENT ?

Is this correct?

Also regarding packet flags, I happen to use another bit for my own
purpose. It doesn't seem to hurt ENet operations, and I haven't seen
code that could be affected by this. But is is something I can
dependably rely on?


Regards,


-- 
Benoit.


More information about the ENet-discuss mailing list