Actually, now that I know freeCallback is intended for this use, I've added GetUserData and SetUserData functions on Packet (which sets the free callback and links to a dictionary internally). A Freed event is just gravy with that in place. No cost in CPU time if it isn't used. Either way it's easier:

packet.Freed += p => { my code };

I've put the new version up on my page for it and on NuGet. Let me know if this is of use. :)

James

On 2/27/2013 2:23 AM, BS Flasher wrote:

    BS Flasher:

    Yes, I can make a method to let you get a callback on free. That
    is no problem.
    I want to make sure the methods I add to the C# library are
    useful, since once it's part
    of the library, I don't want to ever remove it, because that would
    breaks people's software.
    So let's figure out the best way and then add it.

    James


James,
Don't touch your code. I added a referenceCount in your binding and I am checking that. This way works. When a packet is received or line is disconnected referenceCount will be 0 and it is sufficient for my problem.

Thank you so much.


_______________________________________________
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