 #################################################################
 
 ###
-x={};require('smc-hub/compute-client').compute_server(cb:(e,s)->console.log(e);x.s=s)
+require('smc-hub/compute-client').compute_server(cb:(e,s)->console.log(e);global.s=s)
 ###
 compute_server_cache = undefined
 exports.compute_server = compute_server = (opts) ->

                                            if STATES[mesg.state].stable
                                                p.emit('stable', mesg.state)
                                    else
                                        winston.debug("mesg (hub <- #{opts.host}): #{misc.to_safe_str(mesg)}")
                            cb()
        ], (err) =>
            opts.cb(err, @_socket_cache[opts.host])
        )

    ###

                                    p.emit(p._state, p)
                                    if STATES[mesg.state].stable
                                        p.emit('stable', mesg.state)
                    cb(undefined, socket)
            return

        info = undefined
        socket = undefined
        async.series([
            (cb) =>
                dbg("getting port and secret...")
                @database.get_compute_server
                    host : host
                    cb   : (err, x) =>
                        info = x; cb(err)
            (cb) =>
                dbg("connecting to #{host}:#{info.port}...")
                misc_node.connect_to_locked_socket
                    host    : host
                    port    : info.port
                    token   : info.secret
                    timeout : 15
                    cb      : (err, _socket) =>
                        if err
                            dbg("failed to connect: #{err}")
                            cb(err)
                        else
                            socket = _socket
                            misc_node.enable_mesg(socket)
                            socket.id = uuid.v4()
                            dbg("successfully connected -- socket #{socket.id}")
