<html><head></head><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12px"><div id="yui_3_16_0_1_1474121031083_10153">Greetings everyone. I am trying to implement multiplayer functionality into a game that only supports single-player. For this I have chosen to use ENet as the UDP networking library. So far so good, I can connect the client to the server, can connect multiple clients, etc. The sync system is like this: The server asks the nearest player to some entities to send information about those. This is done via an unreliable packet which contains two integers, the packet identifier number (so both client and server know what the packet means) and the information, which is the ID of the entity that needs to be synced. The client then replies with an unreliable packet which contains information about the entity (it's position, rotation, velocity, etc.). The server receives the packet, analyzes it and broadcasts it to the other players.</div><div id="yui_3_16_0_1_1474121031083_10164"><br></div><div id="yui_3_16_0_1_1474121031083_10165" dir="ltr">The issue that I am running into is when the server requests the players to give information about the given entities. This is done in a never-ending loop with a sleep of 1 ms in a separate thread. As soon as the last entity is iterated in the loop and the player is requested to send information about his nearest entity (for streaming purposes), the server crashes. If I try sending the requests as reliable packets, once the last packet is supposedly sent, the ENet server stops processing anything, from connections to simple ping requests.</div><div id="yui_3_16_0_1_1474121031083_12056" dir="ltr"><br></div><div id="yui_3_16_0_1_1474121031083_12057" dir="ltr">Here is some debugging info for those who are more experienced in the issue. Feel free to contact me for any other information on this topic.</div><div id="yui_3_16_0_1_1474121031083_10220" dir="ltr"><br></div><div id="yui_3_16_0_1_1474121031083_10221" dir="ltr">Picture of the crash location in protocol.c: <a id="yui_3_16_0_1_1474121031083_12174" href="https://i.gyazo.com/153760a3edab1a34d2530e296af22830.png">https://i.gyazo.com/153760a3edab1a34d2530e296af22830.png</a></div><div id="yui_3_16_0_1_1474121031083_12178" dir="ltr">Sequence of pictures from the first function called to the function which crashes the server:</div><div id="yui_3_16_0_1_1474121031083_12230" dir="ltr"><br></div><div id="yui_3_16_0_1_1474121031083_12274" dir="ltr"><a class="edited-link-editor" id="yui_3_16_0_1_1474121031083_12275" href="https://i.gyazo.com/96fbc69343269d6add779b67f00ab00d.png">https://i.gyazo.com/96fbc69343269d6add779b67f00ab00d.png</a></div><div id="yui_3_16_0_1_1474121031083_12276" dir="ltr"><a class="edited-link-editor" id="yui_3_16_0_1_1474121031083_12285" href="https://i.gyazo.com/db5141a3efc8b1af58cd94d7073f0628.png">https://i.gyazo.com/db5141a3efc8b1af58cd94d7073f0628.png</a></div><div id="yui_3_16_0_1_1474121031083_12347" dir="ltr"><a class="edited-link-editor" id="yui_3_16_0_1_1474121031083_12432" href="https://i.gyazo.com/a3561731ee3bc1090b01f3e616f5ce32.png">https://i.gyazo.com/a3561731ee3bc1090b01f3e616f5ce32.png</a></div><div id="yui_3_16_0_1_1474121031083_12353" dir="ltr"><a class="edited-link-editor" id="yui_3_16_0_1_1474121031083_12433" href="https://i.gyazo.com/ad72a619c73ecd8bc5f3acc0c165a796.png">https://i.gyazo.com/ad72a619c73ecd8bc5f3acc0c165a796.png</a></div><div id="yui_3_16_0_1_1474121031083_12417" dir="ltr"><a href="https://i.gyazo.com/ad72a619c73ecd8bc5f3acc0c165a796.png"><br></a></div><div id="yui_3_16_0_1_1474121031083_12434" dir="ltr"><a href="https://i.gyazo.com/ad72a619c73ecd8bc5f3acc0c165a796.png"><br></a></div><div id="yui_3_16_0_1_1474121031083_12436" dir="ltr">This is the way I send the requests:</div><div id="yui_3_16_0_1_1474121031083_12440" dir="ltr"><a id="yui_3_16_0_1_1474121031083_12464" href="https://i.gyazo.com/ad72a619c73ecd8bc5f3acc0c165a796.png"><b id="yui_3_16_0_1_1474121031083_12446"></b><a class="edited-link-editor" id="yui_3_16_0_1_1474121031083_12463" href="https://i.gyazo.com/f45f12629be16b720b7a85eafbe25ca8.png">https://i.gyazo.com/f45f12629be16b720b7a85eafbe25ca8.png</a><br></a></div><div id="yui_3_16_0_1_1474121031083_13157" dir="ltr"><a id="yui_3_16_0_1_1474121031083_12464" href="https://i.gyazo.com/ad72a619c73ecd8bc5f3acc0c165a796.png"><br></a></div><div id="yui_3_16_0_1_1474121031083_13177" dir="ltr">And this is the function which sends the packets:</div><div id="yui_3_16_0_1_1474121031083_12439" dir="ltr"><a class="edited-link-editor" id="yui_3_16_0_1_1474121031083_12471" href="https://i.gyazo.com/ad72a619c73ecd8bc5f3acc0c165a796.png">https://i.gyazo.com/15374562e81692c8ee331251e9fc2569.png</a></div><div id="yui_3_16_0_1_1474121031083_12164"><br></div><div id="yui_3_16_0_1_1474121031083_14206"><br></div><div id="yui_3_16_0_1_1474121031083_14225">Any help would be kindly appreciated. :)</div><div id="yui_3_16_0_1_1474121031083_14226">Best regards.<br></div><div id="yui_3_16_0_1_1474121031083_12158" dir="ltr"><br></div></div></body></html>