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
_______________________________________________
ENet-discuss mailing list
[email protected]
http://lists.cubik.org/mailman/listinfo/enet-discuss

Reply via email to