Do the counters affect ENet in any negative way should they overflow, or is it okay to not care about that if we&#39;re not using the new features?<br><br><div class="gmail_quote">On Sat, May 15, 2010 at 7:08 AM, Lee Salzman <span dir="ltr">&lt;<a href="mailto:lsalzman1@cox.net">lsalzman1@cox.net</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">You misunderstood me. :)<br>
<br>
I mean a *counter* overflow... as in increment an unsigned int that&#39;s already at max, and rolls back over to 0.<br><font color="#888888">
<br>
Lee</font><div><div></div><div class="h5"><br>
<br>
Andrew Fenn wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

The semantics of these is that they are set to 0 on enet_host_create() but<br>
just increment thereafter. It is the user&#39;s responsibility to<br>
reset them to 0 periodically to prevent them for overflowing.<br>
    <br>
</blockquote>
<br>
What about people that aren&#39;t using these new features, isn&#39;t that<br>
going to trip them up?<br>
<br>
Perhaps it would be better to just contain data since the last time<br>
you have called enet_host_service because I wouldn&#39;t want other users<br>
of the lib to suddenly have buffer overflows in their code after<br>
upgrading.<br>
<br>
On Sat, May 15, 2010 at 6:53 AM, Lee Salzman &lt;<a href="mailto:lsalzman1@cox.net" target="_blank">lsalzman1@cox.net</a>&gt; wrote:<br>
  <br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Okay, this is what I added, which should hopefully suit your needs:<br>
<br>
typedef struct _ENetHost<br>
{<br>
  ... usual stuff here ...<br>
 enet_uint32        totalSentData;               /**&lt; total data sent, user<br>
should reset to 0 as needed to prevent overflow */<br>
 enet_uint32        totalSentPackets;            /**&lt; total UDP packets<br>
sent, user should reset to 0 as needed to prevent overflow */<br>
 enet_uint32        totalReceivedData;           /**&lt; total data received,<br>
user should reset to 0 as needed to prevent overflow */<br>
 enet_uint32        totalReceivedPackets;        /**&lt; total UDP packets<br>
received, user should reset to 0 as needed to prevent overflow */<br>
} ENetHost;<br>
<br>
The semantics of these is that they are set to 0 on enet_host_create() but<br>
just increment thereafter. It is the user&#39;s responsibility to<br>
reset them to 0 periodically to prevent them for overflowing. Suggested<br>
usage pattern would be like:<br>
<br>
myCounter += host -&gt; totalSentData;<br>
host -&gt; totalSentData = 0;<br>
<br>
Also note the total*Packets statistics are in terms of raw UDP packets, i.e.<br>
the aggregates of various ENet commands, so are a better<br>
indicator of the actual network performance than what you were using before,<br>
which was only user packets. Each increment represents<br>
a single enet_socket_send or enet_socket_receive call under the hood. The<br>
total*Data versions reflect the actual size of the buffers sent<br>
or received via the enet_socket_* calls too.<br>
<br>
Lee<br>
<br>
<br>
Andrew Fenn wrote:<br>
    <br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
In that case is there a solution or can we see this possibly being<br>
made easier via the API down the line?<br>
<br>
On Fri, May 14, 2010 at 9:52 PM, Lee Salzman &lt;<a href="mailto:lsalzman1@cox.net" target="_blank">lsalzman1@cox.net</a>&gt; wrote:<br>
<br>
      <br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Keep in mind that reusing those internal ENet statistics is not going to<br>
be<br>
very safe at all, except for the roundTripTime stat. Those *Bandwidth<br>
vars<br>
don&#39;t measure totals and are just limits supplied by the user. And<br>
because<br>
of the whole dispatch queue change I made, lastServicedPeer no longer<br>
exists. :)<br>
<br>
Lee<br>
<br>
Andrew Fenn wrote:<br>
<br>
        <br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

That out of the way, are there any not too difficult things people<br>
would<br>
like to see in 1.2.2?<br>
<br>
<br>
            <br>
</blockquote>
- I use the cmake build system for our project. It&#39;d be great if ENET<br>
included a FindENET.cmake script or better yet just completely change<br>
over from autotools.<br>
<br>
I&#39;ve attached the ENET scripts I use to statically link it into our<br>
project.<br>
<br>
- I&#39;m currently trying to figure out how to get the following data from<br>
ENET:<br>
   - Total data received / sent<br>
   - Data received / sent since the last flush<br>
   - Total packets received / sent<br>
<br>
I&#39;m not so sure those things are features but I&#39;m sure i&#39;m not the<br>
only one that&#39;s confused over how to get that data. So if you could<br>
correct me on the following..<br>
<br>
lHost-&gt;lastServicedPeer-&gt;roundTripTime - I use this for ping time<br>
however it always says 5ms even when I kill the server.<br>
lHost-&gt;incomingBandwidth/1000 - Data in KiB received (always shows the<br>
same number even when killing the server)<br>
lHost-&gt;outgoingBandwidth/1000 - Data in KiB sent (always shows the<br>
same number even when killing the server)<br>
lHost-&gt;lastServicedPeer-&gt;packetsSent - Get&#39;s the packets sent since<br>
the last flush<br>
<br>
          <br>
</blockquote></blockquote></blockquote></blockquote></blockquote>
<br>
_______________________________________________<br>
ENet-discuss mailing list<br>
<a href="mailto:ENet-discuss@cubik.org" target="_blank">ENet-discuss@cubik.org</a><br>
<a href="http://lists.cubik.org/mailman/listinfo/enet-discuss" target="_blank">http://lists.cubik.org/mailman/listinfo/enet-discuss</a><br>
</div></div></blockquote></div><br>