[ENet-discuss] Fragmentation Problem?
Lee Salzman
lsalzman at telerama.com
Wed Dec 3 09:29:46 PST 2003
There is a change I made about a month ago that should have fixed this.
It basically queues a copy of the command ("hostCommand") which is
filled with all the converted values, instead of the original command,
in enet_protocol_handle_send_fragment. Is that fix in your code? If so,
then there is some more evil problem I will have to track down here.
Lee
On Wed, Dec 03, 2003 at 03:38:30PM -0000, Jim Purbrick wrote:
> 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.
>
> _______________________________________________
> ENet-discuss mailing list
> ENet-discuss at cubik.org
> http://lists.cubik.org/mailman/listinfo/enet-discuss
More information about the ENet-discuss
mailing list