         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, canConnectNow: canConnectNow)
+                self.membershipRosterDelegate?.peerDidDisconnect?(peer.role, peer: peer, canConnectNow: self.canConnectNow(peer))
             })
         case .notConnected:
             assert(false, "ERROR: state is being tracked wrong")

                peer.connectAttemptFailAuthRejectCount += 1
            }
            self.dispatch_on_delegate_queue({
                self.membershipRosterDelegate?.peerConnectionAttemptFailed?(peer.role, peer: peer, isAuthRejection: oldState == .awaitingAuth)
            })
        }
    }
    
    fileprivate func disconnectSocket(socket: GCDAsyncSocket?, peer: BPPeer) {

        }
        services = [HHService]()
    }
    fileprivate var lastInterfaceNameChosenForConnect: String?
    open var keepaliveTimer: Timer?
    open var lastReceivedData: Date = Date.init(timeIntervalSince1970: 0)
    open var connect: (()->Void)?
