First, note that you do not want the port owner to die. Therefore, move any "dangerous" code to another process and make the port owner as stupid as possible. This is error correction along the Erlang path. Now, if this process dies, something is really bad, so in this case it may be wise to recycle the port. But since we have moved everything, we expect that this will not happen.
Regarding port 2, it will send a specific message when it ends, so you can organize for your child process to correctly detect this and terminate with it. Cm
http://www.erlang.org/doc/reference_manual/ports.html
I GIVE CRAP ANSWERS
source share