[erlang-questions] closing a port doesn't kill the connected process?
Andrew Stone
stondage123@REDACTED
Thu Mar 25 22:01:17 CET 2010
EOF detected by the client is what we use. It's been in production for a year now without a problem.
-Andrew
----- Original Message ----
From: Robert Virding <rvirding@REDACTED>
To: Jacob Vorreuter <jacob.vorreuter@REDACTED>
Cc: Erlang-Questions Questions <erlang-questions@REDACTED>
Sent: Wed, March 24, 2010 12:47:54 AM
Subject: Re: [erlang-questions] closing a port doesn't kill the connected process?
When the port is closed the spawned port should get an end-of-file on
its stdin. This is the "standard" way for the process to detect when
the port has been closed: an end-of-file on stdin.
Robert
On 22 March 2010 20:00, Jacob Vorreuter <jacob.vorreuter@REDACTED> wrote:
> I'm starting a redis server instance by opening an Erlang port. When the Erlang process exits or I explicitly close the port the os process is not killed. Is there a way to accomplish that?
>
> 1> Port = erlang:open_port({spawn, "redis-server"}, [binary, exit_status]).
> #Port<0.429>
> 2> erlang:port_close(Port).
> true
>
> $ ps -ax | grep redis-server
> 31374 ?? 0:00.02 redis-server
>
> Thanks,
>
> Jake
> ________________________________________________________________
> erlang-questions (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED
>
>
________________________________________________________________
erlang-questions (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED
More information about the erlang-questions
mailing list