             if let delegate = self.membershipAdminDelegate {
                 self.dispatch_on_delegate_queue({
                     delegate.peerConnectionRequest?(peer, invitationHandler: { (inviteAccepted) in
-                        if inviteAccepted && peer.state == .awaitingAuth && sock.isConnected == true {
+                        if peer.state != .awaitingAuth || sock.isConnected != true {
+                            DLog("inviteHandlerBlock: not connected/wrong state, so cannot accept!")
+                            self.logDelegate?.didReadWrite("inviteHandlerBlock, not connected / wrong state!")
+                            if (sock.isConnected) {
+                                self.disconnectSocket(socket: sock, peer: peer)
+                            }
+                        } else if inviteAccepted {
                             peer.state = .authenticated // SERVER-local-peer becomes connected
+                            peer.connectCount += 1
                             // CONVENTION: SERVER sends CLIENT a single 0 to show connection has been accepted, since it isn't possible to send a header for a payload of size zero except here.
                             self.logDelegate?.didReadWrite("writeAuthAcceptance")
                             sock.write(Data.init(count: 1), withTimeout: Timeouts.header.rawValue, tag: DataTag.tag_WRITING.rawValue)
-                            DLog("... accepted (by my delegate)")
+                            DLog("inviteHandlerBlock: accepted (by my delegate)")
                             self.dispatch_on_delegate_queue({
                                 self.membershipRosterDelegate?.peerDidConnect?(.client, peer: peer)
                             })

        sock.synchronouslySetDelegate(nil)
        switch oldState {
        case .authenticated:
            self.dispatch_on_delegate_queue({
                self.membershipRosterDelegate?.peerDidDisconnect?(peer.role, peer: peer)
            })
        case .notConnected:
            assert(false, "ERROR: state is being tracked wrong")
        case .connecting, .awaitingAuth:
            self.dispatch_on_delegate_queue({
                self.membershipRosterDelegate?.peerConnectionAttemptFailed?(peer.role, peer: peer, isAuthRejection: oldState == .awaitingAuth)
            })

            }

            peer.lastReceivedData = Date.init()
            peer.dataRecvCount += 1

            if peer.keepaliveTimer?.isValid == true {
                return
