<br><br><div class="gmail_quote">2013/2/26 BS Flasher <span dir="ltr"><<a href="mailto:bsflasher@gmail.com" target="_blank">bsflasher@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Then you modified the Enet library and created a custom library for yourself.<br></blockquote><div><br>Not really. My binding just does more than just calling the ENet API. It offers a few extensions, among which this packet ack mechanism.<br>

I have a few internal tweaks, but they are minimal.<br>I also have a file transfer layer in the works. Someday I'll submit a pull request at github.<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<br>
1- Is refrenceCount = refcount ?<br></blockquote><div><br>Yes.<br> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
2- What is refrenceCount in your code? As I can see in my code this<br>
parameter is always ( 1 ) in all conditions (for all packets which are<br>
received or not received) and never become 0 or greater than 1.<br></blockquote><div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
3- What operation enet_host_service() do with refrenceCount ?<br>
<br></blockquote><div><br>When you enet_packet_create() a packet, its referenceCount is 0.<br>It is then incremented by each call to enet_packet_send().<br>Internally, when a peer knows that the packet was received, it decrements referenceCount.<br>

If
 you do nothing else, ENet will enet_packet_destroy() any packet whose 
referenceCount reaches 0. You don't have to do anything, it is 
automatic.<br>But if you incremented the packet's referenceCount, then ENet won't make referenceCount go below the amount you added yourself.<br>That's the behaviour I rely on, and it seems to work for me :-).<br>

 
<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
4- Can you convert your code to c#?<br></blockquote><div><br>No, it would probably have to be rewritten entirely, notwithstanding the fact that I am not familiar at all with C#. I make heavy use of the Lua API.<br> </div>

<br></div>-- <br>Benoit.<br>