<div dir="ltr">Thanks allot!</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Aug 17, 2016 at 2:56 PM, Len Holgate <span dir="ltr"><<a href="mailto:len.holgate@jetbyte.com" target="_blank">len.holgate@jetbyte.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-GB" link="blue" vlink="purple"><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">ENet will give you a semi-reliable, fast, udp network layer that has been tested and that works. It will give you a solid base of C code that you can use on the client side on lots of OS’s.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">As for the rest, it depends…<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">I tend to always try and get a single thread of functionality all the way through (end to end) as soon as possible. So I’d probably start with a simple ENet client server system using the ENet source code with no changes. Make sure you have a clean interface to your game logic so that you can throw away the network layer and replace it on the server at a later point. Then get something that works and learn how to load test it to the point that either it is good for what you want or it fails. You want a repeatable load test that doesn’t require people and that can be automated – you’ll learn a lot getting this working ;)<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">If this first version fails to achieve the scalability that you need then begin to think about replacing it, or scaling back your ideas… If you replace it on the server then it’s certainly possible but it’s quite a lot of work.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Threads can be useful, if you know how to work with them. They can also be very dangerous, if you don’t.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Personally I always like to “measure performance from day 0” - <a href="http://www.serverframework.com/asynchronousevents/2010/10/how-to-support-10000-or-more-concurrent-tcp-connections---part-2---perf-tests-from-day-0.html" target="_blank">http://www.serverframework.<wbr>com/asynchronousevents/2010/<wbr>10/how-to-support-10000-or-<wbr>more-concurrent-tcp-<wbr>connections---part-2---perf-<wbr>tests-from-day-0.html</a>  It tends to stop me doing stupid things and then doing things that compound the stupid things until I’ve hosed all possible performance…<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Len<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><a href="http://www.serverframework.com" target="_blank">www.serverframework.com</a><u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><u></u> <u></u></span></p><p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> ENet-discuss [mailto:<a href="mailto:enet-discuss-bounces@cubik.org" target="_blank">enet-discuss-bounces@<wbr>cubik.org</a>] <b>On Behalf Of </b>Meir Yanovich<br><b>Sent:</b> 17 August 2016 12:18</span></p><div><div class="h5"><br><b>To:</b> Discussion of the ENet library <<a href="mailto:enet-discuss@cubik.org" target="_blank">enet-discuss@cubik.org</a>><br><b>Subject:</b> Re: [ENet-discuss] Can i use other UDP server farmework like boost::asio or libuv and enet as client ?<u></u><u></u></div></div><p></p><div><div class="h5"><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">Thanks Len <br>Im not network programmer but done here and there networking . <br>i have allot of years experience in c/c++ . the problem is that i don't sure if the Enet alone will be enough for my needs which are :<br>1. asyce server <u></u><u></u></p><div><p class="MsoNormal">2. game logic all in server game loop done in c or c++ <u></u><u></u></p></div><div><p class="MsoNormal">3. performance as good as it can get . <br>4. can i use threads ? 2 or 3 for DB updates and such ?<br><br>this is small game in scope but planning burst os allot of connections to play . <u></u><u></u></p></div></div><div><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">On Wed, Aug 17, 2016 at 1:39 PM, Len Holgate <<a href="mailto:len.holgate@jetbyte.com" target="_blank">len.holgate@jetbyte.com</a>> wrote:<u></u><u></u></p><blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm"><div><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">You need to determine that it’s not good enough for yourself. It wasn’t appropriate for what we wanted to do. Partly due to perceived performance but more due to threading requirements, scalability and integration issues.</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">One issue that we came across was delaying our sends so that we built up enough data in a datagram. The async nature of our code worked against us a bit here and we needed timers so that we could accumulate and then send and a) not need to accumulate a complete datagram of enet commands (which would create lag) and b) not send every command separately (which would flood the network and be inefficient). The standard ENet code does this nicely based on the polling nature but it was something we needed to deal with and it took us a while to get it right. </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Dispatch of inbound data was quite complex as was our retransmission logic, mainly due to the desire to reduce memory copies where possible.</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Wireshark is your friend ;)</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">I wrote all of the C++ code myself, with the client’s team doing the managed layer, so it’s certainly something that one person can do. It will depend on your familiarity with what you’re doing – I’ve been doing network code for a long time and was writing the ENet protocol using our own framework of which I have intimate knowledge. If you’re learning boost::asio or whatever AND ENet then it may be more complex.</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Len</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><a href="http://www.serverframework.com" target="_blank">www.serverframework.com</a></span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> </span><u></u><u></u></p><p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> ENet-discuss [mailto:<a href="mailto:enet-discuss-bounces@cubik.org" target="_blank">enet-discuss-bounces@<wbr>cubik.org</a>] <b>On Behalf Of </b>Meir Yanovich<br><b>Sent:</b> 17 August 2016 10:59</span><u></u><u></u></p><div><div><p class="MsoNormal"><br><b>To:</b> Discussion of the ENet library <<a href="mailto:enet-discuss@cubik.org" target="_blank">enet-discuss@cubik.org</a>><br><b>Subject:</b> Re: [ENet-discuss] Can i use other UDP server farmework like boost::asio or libuv and enet as client ?<u></u><u></u></p></div></div><div><div><p class="MsoNormal"> <u></u><u></u></p><div><p class="MsoNormal">Hey Len thanks very much answering <u></u><u></u></p><div><p class="MsoNormal">Few more questions if i may <u></u><u></u></p></div><div><p class="MsoNormal">Ok so i understand that the Enet Sever as server  not good good enough . <br>What if i take something like boost::asio or libuv and reverse engineer the protocol of ENet what should i look in to from your experience ?<br>Do you think one men could do it ? or it is team effort ?<u></u><u></u></p></div><div><p class="MsoNormal">Thanks <u></u><u></u></p></div></div><div><p class="MsoNormal"> <u></u><u></u></p><div><p class="MsoNormal">On Wed, Aug 17, 2016 at 12:03 PM, Len Holgate <<a href="mailto:len.holgate@jetbyte.com" target="_blank">len.holgate@jetbyte.com</a>> wrote:<u></u><u></u></p><blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt"><div><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Our server is fully asynchronous in C++ using overlapped I/O (IOCP) and only a few threads for socket I/O (4, generally). It easily supports > 4000 concurrent and active connections with the game logic written in managed code (C#) which we host using the CLR hosting API.</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">We didn’t spend much time with the existing ENet server as it just didn’t fit with what we wanted. We just used it as a way to reverse engineer the protocol requirements.</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Len</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><a href="http://www.serverframework.com" target="_blank">www.serverframework.com</a></span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> </span><u></u><u></u></p><p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> ENet-discuss [mailto:<a href="mailto:enet-discuss-bounces@cubik.org" target="_blank">enet-discuss-bounces@<wbr>cubik.org</a>] <b>On Behalf Of </b>Meir Yanovich<br><b>Sent:</b> 17 August 2016 09:54</span><u></u><u></u></p><div><div><p class="MsoNormal"><br><b>To:</b> Discussion of the ENet library <<a href="mailto:enet-discuss@cubik.org" target="_blank">enet-discuss@cubik.org</a>><br><b>Subject:</b> Re: [ENet-discuss] Can i use other UDP server farmework like boost::asio or libuv and enet as client ?<u></u><u></u></p></div></div><div><div><p class="MsoNormal"> <u></u><u></u></p><div><p class="MsoNormal"><b><span style="font-size:9.5pt">Len Holgate <br></span></b>Thanks! <br>can you please give more info ? <br>is the server thread based or event based ? <br>what is the limits of integrating or extending the enet server ?<u></u><u></u></p></div><div><p class="MsoNormal"> <u></u><u></u></p><div><p class="MsoNormal">On Wed, Aug 17, 2016 at 11:38 AM, Len Holgate <<a href="mailto:len.holgate@jetbyte.com" target="_blank">len.holgate@jetbyte.com</a>> wrote:<u></u><u></u></p><blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt"><div><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">We built a Windows, IOCP based C++ server using the ENet protocol for a client and it’s been working well for around 9 years now. We have had to tweak things a little to get the scalability that they wanted and write it all from scratch but it’s not that complex once you understand how the protocol works.</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Len</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><a href="http://www.serverframework.com" target="_blank">www.serverframework.com</a></span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> </span><u></u><u></u></p><p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> ENet-discuss [mailto:<a href="mailto:enet-discuss-bounces@cubik.org" target="_blank">enet-discuss-bounces@<wbr>cubik.org</a>] <b>On Behalf Of </b>Ruud van Gaal<br><b>Sent:</b> 17 August 2016 09:29<br><b>To:</b> Discussion of the ENet library <<a href="mailto:enet-discuss@cubik.org" target="_blank">enet-discuss@cubik.org</a>><br><b>Subject:</b> Re: [ENet-discuss] Can i use other UDP server farmework like boost::asio or libuv and enet as client ?</span><u></u><u></u></p><div><div><p class="MsoNormal"> <u></u><u></u></p><div><p class="MsoNormal">ENet uses a complicated protocol to do its communication, so to create a server in another framework would effectively mean reverse engineering ENet and typing your own code. It's not like its built on an existing standard protocol.<u></u><u></u></p><div><p class="MsoNormal">So my guess would be to just use ENet where you want to use ENet. ;-)<u></u><u></u></p></div><div><p class="MsoNormal"> <u></u><u></u></p></div><div><p class="MsoNormal">Ruud<u></u><u></u></p></div></div><div><p class="MsoNormal"> <u></u><u></u></p><div><p class="MsoNormal">On Wed, Aug 17, 2016 at 9:32 AM, Meir Yanovich <<a href="mailto:meiry242@gmail.com" target="_blank">meiry242@gmail.com</a>> wrote:<u></u><u></u></p><blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt"><div><p class="MsoNormal">Hello all<br>As i understand from the documents it is best to use enet as the server as it know how to <br>Handle the peers and the UDP ordring and such ... <br>my question is can i implement the server in other c/c++ framework ? <br>is it recommended ? is it easily possible? <br>or the ENet server is strong enough to act as MMO server ? <br>Thanks !<u></u><u></u></p></div><p class="MsoNormal" style="margin-bottom:12.0pt"><br>______________________________<wbr>_________________<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/<wbr>mailman/listinfo/enet-discuss</a><u></u><u></u></p></blockquote></div><p class="MsoNormal"> <u></u><u></u></p></div></div></div></div></div><p class="MsoNormal" style="margin-bottom:12.0pt"><br>______________________________<wbr>_________________<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/<wbr>mailman/listinfo/enet-discuss</a><u></u><u></u></p></blockquote></div><p class="MsoNormal"> <u></u><u></u></p></div></div></div></div></div><p class="MsoNormal" style="margin-bottom:12.0pt"><br>______________________________<wbr>_________________<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/<wbr>mailman/listinfo/enet-discuss</a><u></u><u></u></p></blockquote></div><p class="MsoNormal"> <u></u><u></u></p></div></div></div></div></div><p class="MsoNormal" style="margin-bottom:12.0pt"><br>______________________________<wbr>_________________<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/<wbr>mailman/listinfo/enet-discuss</a><u></u><u></u></p></blockquote></div><p class="MsoNormal"><u></u> <u></u></p></div></div></div></div></div><br>______________________________<wbr>_________________<br>
ENet-discuss mailing list<br>
<a href="mailto:ENet-discuss@cubik.org">ENet-discuss@cubik.org</a><br>
<a href="http://lists.cubik.org/mailman/listinfo/enet-discuss" rel="noreferrer" target="_blank">http://lists.cubik.org/<wbr>mailman/listinfo/enet-discuss</a><br>
<br></blockquote></div><br></div>