winforms - SignalR Self-Host App Stops listening when machine goes to Sleep mode and later resumes -


i have created self host signalr application hosted within winform application (systray based) , working fine. clients same network able connect , request work , gets status once work finishes.

the problem comes when machine on winform application running goes in sleep mode , comes (power supply resumed) after few minutes. in case singalr component stops listening , no client able connect application after that.

to manage situation, added handler microsoft.win32.systemevents.powermodechanged event, notification when power resumes, part of event handler starting service again disposing off singalr object (using signalr.dispose()) & reinitialising object (signalr = webapp.start(serviceurl)). reason same doesn’t seems working.

as part of same winform application, have got different thread running, after every few seconds tries connect signalr service , calls function called ping(), doesn’t more letting application know, if singalr service , running or not. works fine normally, after coming sleep mode , after reinitialising signalr object, still not able connect singalr service because connection state keeps showing me connecting.

also when reinitialise signalr object, after power resume event, able browse onto service address http://localhost:1234/signalr/hubs, shows me contents of asp.net signalr javascript library, service not available connection.

i have been struggling issue past 2 days , did lot of search not able find similar issue. able find on stackoverflow , other sites machine client component going sleep mode. in case have got machine server/hub component going sleep mode.

any suggestions how sort issue out appreciated.

thanks


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -