<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">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.<br></div><div><div><br></div><div>-- <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</div></div></div></div></div></div>
</div></div></div></div>