@Override
                public void close() throws GuacamoleException {

                    // Stop connection from being joined further
                    activeConnections.remove(id, connectionID);

                    // Close all connections sharing the closed connection
                    Collection<GuacamoleTunnel> tunnels = shadowers.remove(connectionID);
                    if (tunnels != null)
                        closeAll(tunnels);

                    socket.close();

                }
Establishes a connection to guacd using the information associated with
the given connection object. The resulting connection will be provided
the given client information during the Guacamole protocol handshake.

@param connection
    The connection object describing the nature of the connection to be
    established.

@param info
    Information associated with the connecting client.

@return
    A fully-established GuacamoleTunnel.

@throws GuacamoleException
    If an error occurs while connecting to guacd, or if permission to
    connect is denied.
extensions/guacamole-auth-json/src/main/java/org/apache/guacamole/auth/json/connection/ConnectionService.java