lsalzman / enet

ENet reliable UDP networking library
MIT License
2.78k stars 675 forks source link

How to handle the event where packet has been acknowledged by client? #180

Closed playingoDEERUX closed 3 years ago

playingoDEERUX commented 3 years ago

Hello,

I wanted to ask if there is any possible way to execute a function whenever a certain ENetPacket has been acknowledged by a client, instead of blindly using enet_peer_send and assuming that the packet is gonna arrive and then just calling a function right after.

Is there any way to test the ACKNOWLEDGEMENT of an ENetPacket, thus responding accordingly, or am I forced to call functions blindly after a packet has been enqueued on the host.

Thanks.

lsalzman commented 3 years ago

Use the packet freeCallback.

On Sat, Nov 6, 2021 at 12:57 PM playingoDEERUX @.***> wrote:

Hello,

I wanted to ask if there is any possible way to execute a function whenever a certain ENetPacket has been acknowledged by a client, instead of blindly using enet_peer_send and assuming that the packet is gonna arrive and then just calling a function right after.

Is there any way to test the ACKNOWLEDGEMENT of an ENetPacket or am I forced to call functions blindly after a packet has been enqueued on the host.

Thanks.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/lsalzman/enet/issues/180, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALDVUP6JTFCKGCBWZMA7J3UKVM7RANCNFSM5HPZGBWA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.