m-expunged / guacamole-sharp

C# replacement of the Apache Guacamole server-side Java servlet.
Apache License 2.0
26 stars 3 forks source link

The I/O operation has been aborted because of either a thread exit or an application request #19

Closed e2gun closed 1 year ago

e2gun commented 1 year ago

When we closed browser executing RDP or SSH session, we got an error on debug mode that's "The I/O operation has been aborted because of either a thread exit or an application request". Thus, we think that this exception is caused in websocket. Is it true or false? if it is true how can we handle closing websocket or does it cause problems on release premise? Thanks for your help.

m-expunged commented 1 year ago

Are you using 1.0.0 or 2.1.0 (master branch)?

My quick guess would be that guacamole-common-js isn't sending the disconnect message when you close the browser. In the Angular example (included in repo) I handled the close event like this:

    // Disconnect on close
    window.onunload = () => {
      client.disconnect();
    };

Reading through the docs for window.onunload, it isn't triggered reliably on browser close apparently. You could try out some of the other unload events for a quick fix until I've got the time to investigate. https://developer.mozilla.org/en-US/docs/Web/API/Window/unload_event

m-expunged commented 1 year ago

Played around with the 2.1.0 Version, can't replicate the exception for now. Can you post a snippet of the client side code, exception message etc.?

e2gun commented 1 year ago

Thanks your answer. We tried sub code window.onunload = () => { client.disconnect(); }; but problem has not been solved yet. We still get these errors (guacamole-sharp file logs and visual studio 2022 exception code)

image image

Thanks..

m-expunged commented 1 year ago

Try out the newer Version of guacamole-sharp. Version 1.0.0 still uses my hacky implementation for WebSocket Frame parsing.

Might also be a problem with not running it in docker? If you are using IIS you'll most likely have to adjust the source code in some places.

https://learn.microsoft.com/en-us/aspnet/core/fundamentals/websockets?view=aspnetcore-6.0#prerequisites-1