<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Use erlang:send_after and measure the time it actually took for the message to arrive. If it’s much longer the machine was in sleep mode. Don’t know about the networking issues. You could do init:restart() if it’s really necessary.<div class=""><br class=""></div><div class=""><br class=""></div><div class="">Regards,</div><div class="">Sergej<br class=""><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 7 Sep 2017, at 06:49, Frank Muller <<a href="mailto:frank.muller.erl@gmail.com" class="">frank.muller.erl@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><span style="font-family:UICTFontTextStyleBody;font-size:17px" class="">Hi</span><br style="font-family:UICTFontTextStyleBody;font-size:17px" class=""><span style="font-family:UICTFontTextStyleBody;font-size:17px" class=""></span><br style="font-family:UICTFontTextStyleBody;font-size:17px" class=""><span style="font-family:UICTFontTextStyleBody;font-size:17px" class="">I’ve a simple Erlang application under Windows. It runs under erlsrv.exe and all is good.</span><div dir="auto" class=""><br style="font-family:UICTFontTextStyleBody;font-size:17px" class=""><span style="font-family:UICTFontTextStyleBody;font-size:17px" class="">However, I’ve noticed that when the machine enters sleep mode, my app "must be manually restarted" to work again.</span><br style="font-family:UICTFontTextStyleBody;font-size:17px" class=""><span style="font-family:UICTFontTextStyleBody;font-size:17px" class=""><br class=""></span></div><div dir="auto" class=""><span style="font-family:UICTFontTextStyleBody;font-size:17px" class="">The reason is still not clear to me, but i suspect the fact that it loses internet connectivity.</span><br style="font-family:UICTFontTextStyleBody;font-size:17px" class=""><span style="font-family:UICTFontTextStyleBody;font-size:17px" class=""></span><br style="font-family:UICTFontTextStyleBody;font-size:17px" class=""><span style="font-family:UICTFontTextStyleBody;font-size:17px" class="">Questions:</span><br style="font-family:UICTFontTextStyleBody;font-size:17px" class=""><span style="font-family:UICTFontTextStyleBody;font-size:17px" class="">1. Can I detect the sleep mode and recover from it programmatically?</span><br style="font-family:UICTFontTextStyleBody;font-size:17px" class=""><span style="font-family:UICTFontTextStyleBody;font-size:17px" class="">2. To avoid restarting the app, is it possible to restart only the networking part of the VM (not even sure if such a thing exits/feasible)?</span><br style="font-family:UICTFontTextStyleBody;font-size:17px" class=""><span style="font-family:UICTFontTextStyleBody;font-size:17px" class=""></span><br style="font-family:UICTFontTextStyleBody;font-size:17px" class=""><span style="font-family:UICTFontTextStyleBody;font-size:17px" class="">Thanks in advance.</span><br style="font-family:UICTFontTextStyleBody;font-size:17px" class=""><span style="font-family:UICTFontTextStyleBody;font-size:17px" class=""></span><br style="font-family:UICTFontTextStyleBody;font-size:17px" class=""><span style="font-family:UICTFontTextStyleBody;font-size:17px" class="">/Frank</span></div>
_______________________________________________<br class="">erlang-questions mailing list<br class=""><a href="mailto:erlang-questions@erlang.org" class="">erlang-questions@erlang.org</a><br class="">http://erlang.org/mailman/listinfo/erlang-questions<br class=""></div></blockquote></div><br class=""></div></div></body></html>