[ENet-discuss] enet 1.3.6 dll for .net

Benoit Germain bnt.germain at gmail.com
Tue Feb 26 02:02:10 PST 2013


2013/2/26 BS Flasher <bsflasher at gmail.com>

> Then you modified the Enet library and created a custom library for
> yourself.
>

Not really. My binding just does more than just calling the ENet API. It
offers a few extensions, among which this packet ack mechanism.
I have a few internal tweaks, but they are minimal.
I also have a file transfer layer in the works. Someday I'll submit a pull
request at github.


>
> 1- Is refrenceCount = refcount ?
>

Yes.


>
> 2- What is refrenceCount in your code? As I can see in my code this
> parameter is always ( 1 ) in all conditions (for all packets which are
> received or not received) and never become 0 or greater than 1.
>
3- What operation enet_host_service() do with refrenceCount ?
>
>
When you enet_packet_create() a packet, its referenceCount is 0.
It is then incremented by each call to enet_packet_send().
Internally, when a peer knows that the packet was received, it decrements
referenceCount.
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.
But if you incremented the packet's referenceCount, then ENet won't make
referenceCount go below the amount you added yourself.
That's the behaviour I rely on, and it seems to work for me :-).



> 4- Can you convert your code to c#?
>

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.


-- 
Benoit.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cubik.org/pipermail/enet-discuss/attachments/20130226/0b499386/attachment.html>


More information about the ENet-discuss mailing list