Hacker News new | ask | show | jobs
Why Erlang? - In-A-Gist Blog (blog.inagist.com)
70 points by jebu 5570 days ago
2 comments

Nice writeup - what websocket implementation are you using?
Cool. There are a few disparate erlang implementation right now. Misultin has one, zotonic has one, I patched mochiweb to support websockets on the same port too: https://github.com/RJ/mochiweb
Definitely disparate, and it seems to be the case with the web frameworks as well. Going to check out Jebu's implementation. Have been using Misultin, which has been great thus far.
Nice this started out as a fun implementation and now does transparent SSL and flash policy responses. Uses port forwarding to server on different ports.
I'm also coding an Erlang websocket app. In my implementation a simple_one_for_one spawns a new gen_server when a connection is accepted. It looks a little prettier because all the spawning, sending and receiving is now handled by the OTP. I also use active sockets, but I'm a bit worried about flood protection, what's your strategy?
I have the websocket server as a gen_server process which could be tied into an existing supervisor. Each connected client is an Erlang process a non gen-server one primarily because restarting a failed client is almost useless since the n/w connection cannot be reconnected. For flood prevention i use a simple concurrent connection counter and limit the max concurrent connections.
Was a great article until I clicked on the Libya link at the top and it took me to Justin Bieber. Just glad nobody walked into my office at that time.
Ooops.. just fixed it, thanks for letting know