alexdresko / HSPI

HomeSeer plugin helper framework
MIT License
11 stars 11 forks source link

When Homeseer disconnects the plugin the plugin hangs #65

Open oesolberg opened 7 years ago

oesolberg commented 7 years ago

I have only done this with Homeseer on another machine. Start a plugin. Go into Homeseer and disconnect the plugin. The plugin will hang with the message "Connection to homeseer lost, exiting"

I guess this is because the Connector does not have any check if the connection is lost and does not shut the whole program down.

alexdresko commented 7 years ago

Thanks for reporting, @oesolberg. I'll try take a look at this soon.

alexdresko commented 7 years ago

@oesolberg Can you explain how to reproduce this problem? Here's what I'm seeing:

  1. Start HS
  2. Start the plug in Visual Studio
  3. Shutdown HS
  4. The plugin shuts down almost immediately

Do you mean that this is happening when the plugin is installed as opposed to running it from VS? If you can help me reproduce the problem, I'll definitely fix it.

oesolberg commented 7 years ago

Start HS Start the plug in Visual Studio Go into HS, manage plugins and disconnect the plugin(HS keeps running)

dpmurphy commented 7 years ago

Isn't that the expected bahavior?

On Jun 4, 2017, at 12:07 AM, Odd Erik Midthaug notifications@github.com wrote:

Start HS Start the plug in Visual Studio Go into HS, manage plugins and disconnect the plugin(HS keeps running)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

oesolberg commented 7 years ago

Not that the plugin does not stop. Homeseer is expected to go on, but the disconnected plugin shoul quit/exit or try to reconnect. As it is today it reports that it lost connection and then stays on. I would expect the plugin to exit.

dpmurphy commented 7 years ago

You are correct the plugin should stop, I misread your post.

On Jun 4, 2017, at 8:49 AM, Odd Erik Midthaug notifications@github.com wrote:

Not that the plugin does not stop. Homeseer is expected to go on, but the disconnected plugin shoul quit/exit or try to reconnect. As it is today it reports that it lost connection and then stays on. I would expect the plugin to exit.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

oesolberg commented 7 years ago

No worries. I should have been more specific.

alexdresko commented 7 years ago

@oesolberg I finally have a fix for this in the dev branch. If you're in a hurry for the fix, I can publish immediately. Otherwise, it'll get included in the next round of updates... probably within the next week or two.

oesolberg commented 7 years ago

Great work. Thanks

zimmer62 commented 7 years ago

I found that doing an Environment.Exit(0) was not ideal for me. I ended up needing to do both CallbackClient.Dispose(); HsClient.Dispose();

Now this posed a little problem for me as the CallbackClient and the HsClient are not publicly accessible from where I was running the connector.

alexdresko commented 6 years ago

Reopening to implement the suggestion from @zimmer62