<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:12pt"><div>On close a port program may need to perform additional steps to close down gracefully, turn off hardware, log out of facilities, remove files, log events, etc.<br><br>A heartbeat system is effective if the pipe closure event is not reliably delivered; ie. exit if no event from the erlang node for N seconds.<br><br>If erlang is exiting gracefully then send a shutdown command to the port program and wait for the port to be closed.<br><br>--<br>  Rich<br></div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><font size="2" face="Tahoma"><hr size="1"><b><span style="font-weight: bold;">From:</span></b> Camille Troillard <tuscland@gmail.com><br><b><span style="font-weight:
 bold;">To:</span></b> erlang-questions@erlang.org<br><b><span style="font-weight: bold;">Sent:</span></b> Thursday, 30 April, 2009 8:50:09 PM<br><b><span style="font-weight: bold;">Subject:</span></b> [erlang-questions] open_port and port_close semantics<br></font><br>Hello,<div><br></div><div>I am trying to understand the semantics of open_port and port_close.</div><div>I was expecting port_close to send a quit signal to the child process, but it merely close the file handlers from what I've read in the doc and trapexit forums.</div>
<div><br></div><div>What is the reason behind this?</div><div>How do you make sure there are no leftover processes when the application shuts down?</div><br></div></div></div><br>
      <hr size=1>Enjoy a better web experience. Upgrade to the new Internet Explorer 8 optimised for Yahoo!7. <a href="http://au.rd.yahoo.com/search/ie8/mailtagline/*http://us.lrd.yahoo.com/_ylc=X3oDMTJxbnQwdTJhBF9zAzIxNDIwMjU2NTkEdG1fZG1lY2gDVGV4dCBMaW5rBHRtX2xuawNVMTEwMzQ0OAR0bV9uZXQDWWFob28hBHRtX3BvcwN0YWdsaW5lBHRtX3BwdHkDYXVueg--/SIG=11k6t9t1c/**http://downloads.yahoo.com/au/internetexplorer/" target=_blank>Get it now.</a>.</body></html>