                     c(undefined, socket)
 
                 @_socket = socket
+            cancel_connecting()
 
     # Get a new connection to the local_hub,
     # authenticated via the secret_token, and enhanced


        @local_hub_socket (err, socket) =>
            if err
                opts.cb?(err)
                return
            @dbg("call: get socket -- now writing message to the socket")

# with our message protocol.

_project_cache = {}
new_project = (project_id) ->
    P = _project_cache[project_id]
    if not P?
        P = new Project(project_id)
        _project_cache[project_id] = P
    return P

class Project
    constructor: (@project_id) ->
        @dbg("instantiating Project class")
        @local_hub = new_local_hub(@project_id)
        # we always look this up and cache it; it can be useful, e.g., in
        # the activity table.
        @get_info()
