Hacker News new | ask | show | jobs
by linkmotif 2829 days ago
There's a standard, built-in way to handle events on a TCP socket? Like Netty or Node's `net` package.
1 comments

I'm not familiar with Netty, but in Erlang you set `active` mode which means Erlang will send your process messages for all incoming events for a socket: http://erlang.org/doc/man/inet.html#setopts-2

You can further use `{active, N}` to limit the "events" to a certain number as to apply back pressure to the OS socket level and beyond.