Oh, I just thought of one other way, that doesn't even require hacking into
the library. Just set the freeCallback in the packet. There are only two
cases a reliable packet ever actually gets freed: when all queues it has
been entered into finally sent it, or if the connection got disconnected
before that happened. Either way, the freeCallback was actually put in for
subversive purposes like this.

On Fri, May 25, 2012 at 6:15 AM, Lee Salzman <[email protected]> wrote:

> Well, a stupid simple way of doing this cleanly if you don't mind hacking
> the code a bit:
>
> Take a look into enet_protocol_remove_sent_reliable_command(). If you
> check near the bottom there is a bit that looks like:
>
> if (outgoingCommand -> packet != NULL)
> {
> ...
> }
>
> You could just do something in there to notify your app that packet has
> been acknowledged. Ignore the siren's song of the "wasSent" var, it's not
> actually relevant for this, though.
>
>
> On Fri, May 25, 2012 at 5:32 AM, Thorbjørn Lindeijer 
> <[email protected]>wrote:
>
>> On Fri, May 25, 2012 at 2:26 PM, Lee Salzman <[email protected]> wrote:
>> > ENET_EVENT_TYPE_RECEIVE. Don't be silly, man. :)
>>
>> That is "a packet has been received from a peer", while I'm sure
>> Emmanuel was asking about a way of knowing whether a sent packet has
>> arrived at the target peer. :)
>>
>> - Bjørn
>>
>> > On Fri, May 25, 2012 at 12:36 AM, Emmanuel Rivoire <
>> [email protected]>
>> > wrote:
>> >>
>> >> Hello,
>> >>
>> >> is there an easy way to know if a reliable packet has been delivered ?
>> >>
>> >> Checking the current value of
>> >> ENetPeer::channels[PacketChannel].outgoingReliableSequenceNumber just
>> after
>> >> have called enet_host_service() , and then waiting to get that value
>> (or
>> >> above) in
>> ENetPeer::channels[PacketChannel].incomingReliableSequenceNumber
>> >> would be enough to do the trick ?
>> >>
>> >
>> > _______________________________________________
>> > ENet-discuss mailing list
>> > [email protected]
>> > http://lists.cubik.org/mailman/listinfo/enet-discuss
>> >
>> _______________________________________________
>> ENet-discuss mailing list
>> [email protected]
>> http://lists.cubik.org/mailman/listinfo/enet-discuss
>>
>
>
_______________________________________________
ENet-discuss mailing list
[email protected]
http://lists.cubik.org/mailman/listinfo/enet-discuss

Reply via email to