Or Cohen created GUACAMOLE-431:
----------------------------------

             Summary: Tunnel implementations handles close only once
                 Key: GUACAMOLE-431
                 URL: https://issues.apache.org/jira/browse/GUACAMOLE-431
             Project: Guacamole
          Issue Type: Bug
          Components: guacamole-common-js
    Affects Versions: 0.9.13-incubating
            Reporter: Or Cohen
            Priority: Minor


Previously [asked on the mailing 
list|http://mail-archives.apache.org/mod_mbox/incubator-guacamole-dev/201708.mbox/browser].
 Opening an issue to submit a PR.

-------

Tunnel implementations (WebSocket and HTTP) only handle the closing flow once. 
It's not that they're not re-usable, but if they are in a {{CLOSED}} state and 
another {{connect()}} call is issued, it doesn't handle the second failure 
properly. Making it impossible to automatically know about a subsequent error.

On the second failure, the {{onerror}} and {{onstatechange}} callbacks are not 
called. For example, this is log output of the behavior:

{noformat}
// Connecting to a running proxy
guac.onstatechange 1 STATE_CONNECTING
guac.onstatechange 2 STATE_WAITING
tunnel.onstatechange 1 OPEN
guac.onstatechange 3 STATE_CONNECTED

// Killing proxy/guacd
tunnel.onerror Guacamole.Status {code: NaN, message: "Shutdown", isError: ƒ}
tunnel.onstatechange 2 CLOSED
Tunnel disconnected, place retry handling here

// Reconnecting by calling connect on the same Client instance
guac.onstatechange 1 STATE_CONNECTING
guac.onstatechange 2 STATE_WAITING
WebSocket connection to 'ws://localhost:8080/websocket..' failed: Error in 
connection establishment: net::ERR_CONNECTION_REFUSED

// No state change from tunnel, it will just hang like this
{noformat}

I was wondering how the Guacamole application handles this since it does work 
as expected. I saw that it doesn't really re-use the client, but creates a new 
one.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to