<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">If I had only 20ms of latency I would
not mind. However if multiple enet_host_service needs to be called
to receive the full 3mb of data, then yes it starts to be
noticeable. That is what I am wondering.<br>
<br>
<br>
On 4/30/2013 9:16 AM, Doug Warren wrote:<br>
</div>
<blockquote
cite="mid:CAL4fHfxtFsbXefr3pw7dFNqap1vr5cfGzMPHUTCJjDd7-SsZXw@mail.gmail.com"
type="cite">
<div dir="ltr">enet_host_service has a built in timeout if no
packets are received. By only calling it every 20ms you are
introducing a fair amount of latency into the processing of the
packets. What I had best luck doing is running it enet on a
background thread with an incoming/outgoing queue of messages
to/from the main threads with a 10ms timeout in
enet_host_service, something like:
<div>
<pre style="margin-top:0px;margin-bottom:0px;padding:0px;border:0px;font-size:12px;font-family:Consolas,'Liberation Mono',Courier,monospace;color:rgb(51,51,51);line-height:18px"><div class="" id="LC21" style="margin:0px;padding:0px 0px 0px 10px;border:0px">
<span class="" style="margin:0px;padding:0px;border:0px;font-weight:bold">static</span> <span class="" style="margin:0px;padding:0px;border:0px;color:rgb(68,85,136);font-weight:bold">int</span> <span class="" style="margin:0px;padding:0px;border:0px">SERVER_UPDATE_TIMER</span> <span class="" style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">10</span><span class="" style="margin:0px;padding:0px;border:0px">;</span><div>
</div></div></pre>
</div>
<div>
<pre style="margin-top:0px;margin-bottom:0px;padding:0px;border:0px;font-size:12px;font-family:Consolas,'Liberation Mono',Courier,monospace;color:rgb(51,51,51);line-height:18px"><div class="" id="LC315" style="margin:0px;padding:0px 0px 0px 10px;border:0px">
<span class="" style="margin:0px;padding:0px;border:0px;font-weight:bold">while</span> <span class="" style="margin:0px;padding:0px;border:0px">(</span><span class="" style="margin:0px;padding:0px;border:0px;font-weight:bold">!</span><span class="" style="margin:0px;padding:0px;border:0px">_serverClosed</span> <span class="" style="margin:0px;padding:0px;border:0px;font-weight:bold">&&</span> <span class="" style="margin:0px;padding:0px;border:0px">((</span><span class="" style="margin:0px;padding:0px;border:0px">result</span> <span class="" style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span class="" style="margin:0px;padding:0px;border:0px">enet_host_service</span><span class="" style="margin:0px;padding:0px;border:0px">(</span><span class="" style="margin:0px;padding:0px;border:0px">_enetHost</span><span class="" style="margin:0px;padding:0px;border:0px">,</span> <span class="" style="margin:0px;padding:0px;border:0px;font-wei
ght:bold">&</span><span class="" style="margin:0px;padding:0px;border:0px">event</span><span class="" style="margin:0px;padding:0px;border:0px">,</span> <span class="" style="margin:0px;padding:0px;border:0px">SERVER_UPDATE_TIMER</span><span class="" style="margin:0px;padding:0px;border:0px">))</span> <span class="" style="margin:0px;padding:0px;border:0px;font-weight:bold">>=</span> <span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,153,153)">0</span><span class="" style="margin:0px;padding:0px;border:0px">))</span></div>
<div class="" id="LC316" style="margin:0px;padding:0px 0px 0px 10px;border:0px"> <span class="" style="margin:0px;padding:0px;border:0px">{</span><div style=""> // Process event
</div><div style=""> ...
</div>
<div style=""> // Process outgoing events
</div><div style=""> while(outgoingQueue.getNext(outEvent))
</div><div style=""> {
</div><div style=""> ...
</div><div style=""> }
</div><div style="">
}
</div></div></pre>
</div>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On Tue, Apr 30, 2013 at 5:29 AM,
Sebastien Robillard <span dir="ltr"><<a
moz-do-not-send="true"
href="mailto:s.robillard@trio-tech.com" target="_blank">s.robillard@trio-tech.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">I am using
enet 1.3.3 and I have an issue that might be related to
enet. I am sending a reliable packet of about 3.5 mb over a
local network and it takes approximately 8 seconds to
receive it, which I believe should be much faster. I have a
few questions on how enet handles these packets.<br>
<br>
1. Do the frequency of the call to enet_host_service (on
either the sender or receiver end) matters for the time it
takes to transfer the packet ?<br>
2. If so, would it change something if I call
enet_host_service with a timeout ? Currently I have a
timeout of 0, and move on if there are no events.
enet_host_service is called every frame (~20 ms)<br>
3. Can we play with packet or buffer sizes in the enet
library to improve the speed in my specific case ? I'm
looking at defines like ENET_HOST_RECEIVE_BUFFER_SIZE or
ENET_HOST_SEND_BUFFER_SIZE<br>
<br>
Thanks,<br>
Sebastien<br>
_______________________________________________<br>
ENet-discuss mailing list<br>
<a moz-do-not-send="true"
href="mailto:ENet-discuss@cubik.org" target="_blank">ENet-discuss@cubik.org</a><br>
<a moz-do-not-send="true"
href="http://lists.cubik.org/mailman/listinfo/enet-discuss"
target="_blank">http://lists.cubik.org/mailman/listinfo/enet-discuss</a><br>
</blockquote>
</div>
<br>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
ENet-discuss mailing list
<a class="moz-txt-link-abbreviated" href="mailto:ENet-discuss@cubik.org">ENet-discuss@cubik.org</a>
<a class="moz-txt-link-freetext" href="http://lists.cubik.org/mailman/listinfo/enet-discuss">http://lists.cubik.org/mailman/listinfo/enet-discuss</a>
</pre>
</blockquote>
<br>
</body>
</html>