     public func serviceBrowser(_ serviceBrowser: HHServiceBrowser, didRemove service: HHService, moreComing: Bool) {
         NSLog("BluepeerObject: didRemoveService \(service.name)")
         if let peer = self.peers.filter({ $0.dnsService == service }).first {
+            peer.dnsService?.endResolve()
             peer.dnsService = nil
             peer.announced = false
             self.dispatch_on_delegate_queue({

                self.peers.append(peer)
                NSLog("BluepeerObject didFind: created new peer \(peer.displayName). Peers.count after adding: \(self.peers.count)")
            } else {
                NSLog("BluepeerObject didFind: found existing peer \(peer?.displayName) with same service - no-op!")
            }

            let prots = UInt32(kDNSServiceProtocol_IPv4) | UInt32(kDNSServiceProtocol_IPv6)

            peer.socket?.delegate = nil // we don't want to run our disconnection logic below
            peer.socket?.disconnect()
            peer.socket = nil
            peer.dnsService?.endResolve()
            peer.dnsService = nil
            peer.state = .notConnected
            peer.announced = false
        }
        self.killAllKeepaliveTimers()
        self.peers = [] // remove all peers!
