<br><br><div class="gmail_quote">On Sat, Feb 23, 2013 at 2:08 PM, Jarimatti Valkonen <span dir="ltr"><<a href="mailto:jarimatti.valkonen@saunalahti.fi" target="_blank">jarimatti.valkonen@saunalahti.fi</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div class="im"><div>Joe Armstrong <<a href="mailto:erlang@gmail.com" target="_blank">erlang@gmail.com</a>> kirjoitti 22.2.2013 kello 20.31:</div>
<br></div><blockquote type="cite"><div><br></div><div class="im"><div>This launches erlang/cowboy "on demand"</div><div><br></div><div>2) I fetch a web page from "<a href="http://localhost:11234/" target="_blank">http://localhost:11234</a>"</div>
<div><br></div><div>Erlang starts and starts cowboy</div><div><br></div><div>Anybody know what the magic stuff in joe.experiments.plist is?</div></div></blockquote><div><br></div><div>Hi (and apologies for the double post, this was intended to the list)</div>
<div class="im"><div><br></div><div>If you want to launch on-demand when a socket connection is made, then AFAIK it's a bit more complicated than just editing the launchd property list. Launchd listens on the socket and passes the socket into the actual program in it's own data structure.</div>
</div></div></div></blockquote><div><br></div><div>UUm sounds tricky - I actually adopted Tony's method. I start a distributed Erlang node</div><div>with a KeepAlive flag and get it to start cowboy. Not quite the same thing but good enough for</div>
<div>my purposes</div><div><br></div><div>Cheers</div><div><br></div><div>/Joe</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">
<div><div class="im"><div><br></div></div><div>The file format documentation (man 5 launchd.plist) specifies how to configure the socket and there's some Apple sample code here:</div><div><br></div><div><a href="https://developer.apple.com/library/mac/#samplecode/SampleD/Introduction/Intro.html" target="_blank">https://developer.apple.com/library/mac/#samplecode/SampleD/Introduction/Intro.html</a></div>
<div><br></div><div>A full example with plist is included in the download, but the sample launchd plist file is not visible in the web site.</div><div><br></div><div><br></div><div>br,</div><div>Jarimatti</div></div></div>
</blockquote></div><br>