<div dir="ltr"><div><div>OK, some further testing revealed the following. I queued various message types back to back on the host and watched what happened on the receiving peer, on enet_host_flush().<br><br>Queueing 2 messages using enet_host_send() works fine;<br></div>Queueing 1 broadcast followed by 1 message sends only the broadcast;<br>Queueing 1 message followed by 1 broadcast sends only the message.<br>Queueing 2 broadcasts sends only 1 broadcast (presumably the first);<br><br>For anything with broadcasts, the first called function takes effect, the second does not. (I can use a loop of enet_host_send() for now to replace proper broadcasts.)<br></div><div><br></div>Is this a bug?<br></div><div class="gmail_extra"><br><div class="gmail_quote">On 1 July 2015 at 13:50, Nick Wiggill <span dir="ltr"><<a href="mailto:nick.wiggill@gmail.com" target="_blank">nick.wiggill@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">ENet seems to handle send AND receive in one strangely mangled loop when it comes to realtime applications... not sure if this is exactly right, but close enough:<br><div><div><div><br>    ENetEvent event;<br>    if (enet_host_service(localhost, &event, 0) > 0) //0 arg for realtime - non-blocking<br>    {<br>         handleEvent(&event);<br>        <br>        int result = 0;<br>        if (enet_host_check_events(localhost, &event) < 0)<br>            printf("enet_host_check_events failed (unknown reason).\n");<br>        else<br>        {<br>            while (enet_host_check_events(localhost, &event) > 0)<br>            {<br>                handleEvent(&event);<br>            }<br>        }<br>    }<br><br></div>What I'd like is to receive incoming messages, do my processing based off the incoming data, then send out a new set of messages (which feeds back into other peers' receive cycles), *without*  pulling newly received messages out of the enet events list, at a stage when all I want is to *send*... I want those receives still sitting in the event queue when I next do receiving (next frame).<br><br>enet_host_flush sadly doesn't seem to send out all the messages when I have multiple messages queued up to the same peer, which I confirmed here - <a href="http://lists.cubik.org/pipermail/enet-discuss/2013-September/002238.html" target="_blank">http://lists.cubik.org/pipermail/enet-discuss/2013-September/002238.html</a> ... so I'm forced to use enet_host_service / enet_host_check_events which then leads to unwanted receives while I'm trying to send.<span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888"><div><div><br></div><div>-- <br><div><div dir="ltr"><div><div dir="ltr"><div></div><div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Nick</div></div></div></div></div></div>
</div></div></font></span></div></div>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div></div><div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Nick Wiggill</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><b>mobile</b> +27 (0) 825457544<br></div></div></div></div></div></div>
</div>