3 ms·
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 pret
by cron 16y ago
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?
- jebu 16y agoI 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.