I understand the basic difference between active and passive sockets and why we often use active_once in practice. The following paragraph from LYSEFGG raised a few questions:
The idea is that if all packets coming from the outside world are blindly accepted by Erlang and then converted to messages, it is somewhat easy for someone outside of the VM to flood it and kill it. Passive mode has the advantage of restricting how and when messages can be put into the Erlang VM, and delegating the task of blocking, queuing up, and dropping messages to the lower-level implementations.
My questions are:
- If the received packets aren’t in Erlang VM, where are they buffered? How they are handled by OS?
- Can OS buffer also overflow? What happens when it does?
Those questions aren’t directly about Erlang but I’d appreciate any insight provided