Re: erlang text://protocol server?
Jesper Louis Andersen <[email protected]>
| Newsgroups | gmane.comp.lang.erlang.general |
|---|---|
| Message-ID | <CAGrdgiUW4UjT1-2hyx4q4KBd1keUt1Ruw9XOwedmm3GGM-EtLg@mail.gmail.com> |
On Fri, Apr 9, 2021 at 9:26 PM Petite Abeille <[email protected]> wrote: > > That one? > > https://github.com/ninenines/ranch > > That would be in-lieu of djb's tcpserver, right? > > https://cr.yp.to/ucspi-tcp/tcpserver.html > > > Then implementing the lua code should be pretty straightforward. This > looks like a really fun small beginner project that has a tangible output. > > Fun indeed. > > Yes to both! 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. And if something doesn't match, just crash the server. You can always do the error handling later if need be. -- J.