[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)
{
	<snip>
         startSequenceNumber = ENET_HOST_TO_NET_32 (channel ->
outgoingReliableSequenceNumber + 1),
	<snip>
         command.sendFragment.startSequenceNumber = startSequenceNumber;
	<snip>
}

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)
{
	<snip>
	    startSequenceNumber = ENET_NET_TO_HOST_32 (command ->
sendFragment.startSequenceNumber);
	<snip>
       if (startCommand -> command.header.command ==
ENET_PROTOCOL_COMMAND_SEND_FRAGMENT &&
           startCommand -> command.sendFragment.startSequenceNumber ==
startSequenceNumber)
         break;
	<snip>
}

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?

Cheers,

Jim.



More information about the ENet-discuss mailing list