         readLoop()
         ping() // ping once to get this party started
         pingLoop()
+
+        for handlers in self.handlers.values {
+            for registration in handlers.values {
+                let _ = try register(address: registration.address,
+                                     id: registration.id,
+                                     headers: registration.headers,
+                                     handler: registration.handler)
+            }
+        }
     }
 
     /// Disconnects from the remote bridge.
     public func disconnect() {
         if let s = self.socket {
+            for handlers in self.handlers.values {
+                for registration in handlers.values {
+                    // We don't care about errors here, since we're
+                    // not going to be receiving messages anyway. We
+                    // unregister as a convenience to the bridge.
+                    let _ = try? unregister(address: registration.address,
+                                            id: registration.id,
+                                            headers: registration.headers)
+                }
+            }   
             s.close()
             self.socket = nil
         }

        }

        let msg = Message(basis: json, eventBus: self)
        if let h = self.handlers[address] {
            for handler in h.values {
                workQueue.async(execute: { handler(msg) })
            }
        } else if let h = self.replyHandlers[address] {
            workQueue.async(execute: { h(Response(message: msg)) })
        }
    }


    public func register(address: String,
                         id: String? = nil,
                         headers: [String: String]? = nil,
                         handler: @escaping (Message) -> ()) throws -> String {
        let _id = id ?? uuid()
        let _headers = headers ?? [String: String]()
        let registration = Registration(address: address, id: _id, handler: handler, headers: _headers)
        if let _ = self.handlers[address] {
            self.handlers[address]![_id] = registration
        } else {
            self.handlers[address] = [_id : registration]
        }

        try send(JSON(["type": "register", "address": address, "headers": _headers]))

        return _id
    }
