             opts.cb(undefined, socket)
             return
 
+        # IMPORTANT: in case socket gets called many times at once with the same host as input,
+        # we must only get a socket once, then return it to all the callers.
+        if not @_socket_cbs?
+            @_socket_cbs = {}
+        if not @_socket_cbs[opts.host]?
+            @_socket_cbs[opts.host] = [opts.cb]
+            @_get_socket opts.host, (err, socket) =>
+                if socket?
+                    # Cache the socket we just got
+                    @_socket_cache[opts.host] = socket
+                # Get list of callbacks to notify
+                v = @_socket_cbs[opts.host]
+                delete @_socket_cbs[opts.host]  # don't notify again
+                # Notify callbacks
+                for cb in v
+                    cb(err, socket)
+        else
+            @_socket_cbs[opts.host].push(opts.cb)
+
+    # the following is used internally by @socket to actually get a socket, but with no
+    # checking or caching.
+    _get_socket: (host, cb) =>
+        dbg = @dbg("socket(#{host})")
         if @_dev
             dbg("development mode 'socket'")
             require('./compute-server').fake_dev_socket (err, socket) =>
                 if err
-                    opts.cb(err)
+                    cb(err)
                 else
-                    @_socket_cache[opts.host] = socket
+                    @_socket_cache[host] = socket
                     socket.on 'mesg', (type, mesg) =>
                         if type == 'json'
                             if mesg.event == 'project_state_update'

                                            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])
        )

    ###

        opts = defaults opts,
            host : required
            cb   : required
        if not @_socket_cache?
            @_socket_cache = {}
        socket = @_socket_cache[opts.host]
