On Sat, Mar 10, 2018 at 10:19 AM Anto Aravinth <anto.aravinth....@gmail.com>
> Hello all,
> I'm learning golang and I wanted to try out this. Wanted to make a event
> driven server using Kqueue sys call (I'm on mac). A simple echo server will
If you want to learn this, I suggest you start off with something like C
which the kqueue/kevent interface was built for. A Go-idiomatic solution
would usually abstract this away by means of using goroutines.
Also, you code seems to be missing part of the usual socket interface.
Calling net.Listen creates a Listener from which you can draw connections
through the means of Accept(). You want the file descriptors of accepted
sockets in your case I think.
In Go, an acceptor pool would usually spawn of goroutines which will then
accept on the socket and do concurrent work. Note that there are many
considerations in building a robust acceptor pool in general (and I would
wager several exist of varying levels of stability).
 On Mac and BSD, the interface is usually kqueue/kevent. On Linux a
completely different epoll() interface exist (which is a slightly bonkers
API IMO), and on Illumos you have event ports filling in the same problem
Interestingly, systems such as Node.js is just a wrapper on top of these
side. There are many limitations to such a system with regard to system
stability and latency. Especially as projects grow large.
You received this message because you are subscribed to the Google Groups
To unsubscribe from this group and stop receiving emails from it, send an email
For more options, visit https://groups.google.com/d/optout.