[ENet-discuss] If it possible to know if a packet has been delivered ?

Lee Salzman lsalzman at gmail.com
Fri May 25 06:17:34 PDT 2012


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 <lsalzman at gmail.com> 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 <bjorn at lindeijer.nl>wrote:
>
>> On Fri, May 25, 2012 at 2:26 PM, Lee Salzman <lsalzman at gmail.com> 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 <
>> manu.n02 at laposte.net>
>> > 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
>> > ENet-discuss at cubik.org
>> > http://lists.cubik.org/mailman/listinfo/enet-discuss
>> >
>> _______________________________________________
>> ENet-discuss mailing list
>> ENet-discuss at cubik.org
>> http://lists.cubik.org/mailman/listinfo/enet-discuss
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cubik.org/pipermail/enet-discuss/attachments/20120525/394d76f8/attachment.html>


More information about the ENet-discuss mailing list