[ENet-discuss] ENet Control Messages
Lee Salzman
lsalzman1 at cox.net
Wed Sep 12 04:58:59 PDT 2007
Because pretty much all protocol commands need to be acknowledge.
The only exception is a disconnect where you've torn down the connection
before you could ever check for acknowledgement, in which case it is
somewhat moot. And the sequence numbers for protocol commands merely
need to be increasing, not tightly packed, since they are not queued
on the other end at all.
Lee
Giuseppe Greco wrote:
> Hi there,
>
> Looking at the ENet source code, it looks like most of the control
> messages are sent with the ACK flag turned on - meaning they are
> reliable. An exception is the "immediate disconnect" message;
> such a message has the ACK flag turned off and the UNSEQUENCED
> flag turned on.
>
> Well, assuming control messages are sent over channel 0xFF, could
> you explain me why in function enet_peer_queue_outgoing_command()
> only valiable peer->outgoingReliableSequenceNumber is incremented,
> regardless of whether or not the ACK flag is turned on?
>
> Here below is the piece of code I am talking about:
>
> ENetOutgoingCommand *
> enet_peer_queue_outgoing_command (ENetPeer * peer, const ENetProtocol *
> command, ENetPacket * packet, enet_uint32 offset, enet_uint16 length)
> {
> ...
>
> if (command -> header.channelID == 0xFF)
> {
> ++ peer -> outgoingReliableSequenceNumber;
>
> outgoingCommand -> reliableSequenceNumber = peer ->
> outgoingReliableSequenceNumber;
> outgoingCommand -> unreliableSequenceNumber = 0;
> }
>
> ....
>
> return outgoingCommand;
> }
>
> Thanks,
> j3d.
>
> ----------------------------------------
> Giuseppe Greco
> Via Carà 26
> 6928 Manno (TI)
> Switzerland
>
> call giuseppe.greco via Skype
> phone: +41 (0)91 604 67 65
> mobile: +41 (0)79 590 33 06
> email: giuseppe.greco at agamura.com
> ----------------------------------------
> _______________________________________________
> 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