I'm writing a CNode server(using 3rd API DLL) to interact with my erlang program .<br>I cannot find much documents about CNode,are there any best practice for writing CNode?<br><br>For example:<br>1.How to autostart my cnode when start my erlang program(I read some codes in gtknode,which use a 
<br> middleman process links to the gtkNode )<br>2.If I want to auto restart my Cnode when it crash,what is the prefer method to do this?I Think maybe I can use a middleman process to monitor CNode, so when CNode crash, this process exit, and use supervisor to restart this process.
<br>3.How to call ei_xreceive_msg in my Cnode. Official example use a infinite loop, gtknode use g_io_add_watch , is there any function like g_io_add_watch provided in ei ?<br><br>Regards!<br>James<br>