[ENet-discuss] Why not drop it when reliableSequenceNumber < channel -> incomingReliableSequenceNumber?

kaka chen kaka11.chen at gmail.com
Thu Jun 14 19:54:30 PDT 2012


Hi All:

    I am reading the source code of enet-1.3.4, but have some questions
now. Can someone explain when enet_peer_queue_incoming_
commands() process reliable command, if the reliableSequenceNumber <
channel -> incomingReliableSequenceNumber, it will be added at the end of
the channel -> incomingReliableCommands? Then how it worked? Why not drop
it? Thanks!

790     case ENET_PROTOCOL_COMMAND_SEND_RELIABLE:
791        if (reliableSequenceNumber == channel ->
incomingReliableSequenceNumber)
792          goto freePacket;
793
794        for (currentCommand = enet_list_previous (enet_list_end (&
channel -> incomingReliableCommands));
795             currentCommand != enet_list_end (& channel ->
incomingReliableCommands);
796             currentCommand = enet_list_previous (currentCommand))
797        {
798           incomingCommand = (ENetIncomingCommand *) currentCommand;
799
800           if (reliableSequenceNumber >= channel ->
incomingReliableSequenceNumber)
801           {
802              if (incomingCommand -> reliableSequenceNumber < channel ->
incomingReliableSequenceNumber)
803                continue;
804           }
805           else
806           if (incomingCommand -> reliableSequenceNumber >= channel ->
incomingReliableSequenceNumber)
807             break;
808
809           if (incomingCommand -> reliableSequenceNumber <=
reliableSequenceNumber)
810           {
811              if (incomingCommand -> reliableSequenceNumber <
reliableSequenceNumber)
812                break;
813
814              goto freePacket;
815           }
816        }
817        break;

Kaka Chen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cubik.org/pipermail/enet-discuss/attachments/20120615/be81aaf2/attachment.html>


More information about the ENet-discuss mailing list