[erlang-questions] Sharing a UDP socket between processes

Roger Lipscombe roger@REDACTED
Fri Jun 22 17:00:32 CEST 2018


I need to send fire-and-forget UDP messages to a particular
destination. I don't plan on receiving any incoming messages.

I need to be able to send messages from several thousand Erlang
processes. Ordinarily, I'd wrap the socket in a gen_server, but is
there really any need?

Can I simply stash the socket in an ETS table and use it directly?
What possible downsides are there to this?

Or would it be sensible to simply open/send/close a UDP socket each
time? Each process only needs to send a message at startup, and then
every 2 minutes or so. But: there will be several thousand of these
processes spawned at once.



More information about the erlang-questions mailing list