<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><span style="font-family:Arial,Helvetica,sans-serif">On Fri, Apr 9, 2021 at 9:26 PM Petite Abeille <<a href="mailto:petite.abeille@gmail.com">petite.abeille@gmail.com</a>> wrote:</span><br></div></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
That one?<br>
<br>
<a href="https://github.com/ninenines/ranch" rel="noreferrer" target="_blank">https://github.com/ninenines/ranch</a><br>
<br>
That would be in-lieu of djb's tcpserver, right?<br>
<br>
<a href="https://cr.yp.to/ucspi-tcp/tcpserver.html" rel="noreferrer" target="_blank">https://cr.yp.to/ucspi-tcp/tcpserver.html</a><br>
<br>
> Then implementing the lua code should be pretty straightforward. This looks like a really fun small beginner project that has a tangible output.<br>
<br>
Fun indeed.<br>
<br></blockquote><div><br></div><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Yes to both!</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">There's a couple of things one has to do w.r.t asking the socket for information rather than relying on that being set in the os environment, etc. But you should have a fairly straightforward time, especially if you take the same approach the lua code is taking. Just exploit the heck out of pattern matching, and you can fold most of the asserts and substring checks into them. Look up binary pattern matching as well.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">And if something doesn't match, just crash the server. You can always do the error handling later if need be.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"></div><br></div></div><div><br></div>-- <br><div dir="ltr" class="gmail_signature">J.</div></div>