         peer.keepaliveTimer = nil
         peer.socket = nil
         sock.synchronouslySetDelegate(nil)
+        
+        // is it still valid to call connect() on this peer?
+        var canConnectNow = false
+        if let lastService = peer.pickedResolvedService(),
+            let hhaddresses = lastService.resolvedAddressInfo,
+            hhaddresses.count > 0 {
+            canConnectNow = true
+        }
+        
         switch oldState {
         case .authenticated:
             peer.disconnectCount += 1
             self.dispatch_on_delegate_queue({
-                self.membershipRosterDelegate?.peerDidDisconnect?(peer.role, peer: peer)
+                self.membershipRosterDelegate?.peerDidDisconnect?(peer.role, peer: peer, canConnectNow: canConnectNow)
             })
         case .notConnected:
             assert(false, "ERROR: state is being tracked wrong")

                    }
                }
                
                DLog("connectBlock: \(peer.displayName) has \(peer.services.count) svcs (\(peer.resolvedServices().count) resolved); picked service has \(hhaddresses.count) addresses, chose \(chosenAddress.addressAndPortString) on interface \(chosenAddress.interfaceName)")
                let sockdata = chosenAddress.socketAsData()
                
                // TODO: when migrating Wifibooth, blueprint: make sure browserFoundPeer calls stopBrowsing()!

    var versionString: String = "unknown"
    var displayNameSanitized: String = ""
    var appIsInBackground = false
    
    weak open var membershipAdminDelegate: BluepeerMembershipAdminDelegate?
    weak open var membershipRosterDelegate: BluepeerMembershipRosterDelegate?
