[ENet-discuss] Fragmentation Problem?

Jim Purbrick Jpurbrick at climax.co.uk
Wed Dec 3 07:38:30 PST 2003

Hi All,

I'm having problems getting fragmentation working and have found something
that I'd like some clarification on.

enet_peer_send seems to send the startSequenceNumber in network order:

enet_peer_send (ENetPeer * peer, enet_uint8 channelID, ENetPacket * packet)
         startSequenceNumber = ENET_HOST_TO_NET_32 (channel ->
outgoingReliableSequenceNumber + 1),
         command.sendFragment.startSequenceNumber = startSequenceNumber;

enet_protocol_handle_send_fragment then converts the startSequenceNumber
back to host order, but compares
this value to the startSequenceNumber values in the
incomingReliableCommands, which don't seem to have been converted
to host order anywhere. The comparisons then fail and none of the fragments
get reassembled.

enet_protocol_handle_send_fragment (ENetHost * host, ENetPeer * peer, const
ENetProtocol * command)
	    startSequenceNumber = ENET_NET_TO_HOST_32 (command ->
       if (startCommand -> command.header.command ==
           startCommand -> command.sendFragment.startSequenceNumber ==

I must be missing something here, but can't see where the
startSequenceNumbers in the queued incomingReliableCommands
get converted back to host order. If I comment out the net to host
conversion in enet_protocol_handle_send_fragment,
both startSequenceNumbers are in NBO and the comparison succeeds.

Anyone got any idea what's going on here?



More information about the ENet-discuss mailing list