Rogue Multipeer Sessions

I am attempting to write a simple peer-to-peer chat app using MultipeerSession (which chooses WiFi or BT depending on which is available)

I currently have ONE (and only one instance) running in an iPhone simulator… it logs the following messages on startup

init
start advertise
ServiceBrowser found peer: <MCPeerID: 0x6000004442b0 DisplayName = theSERVER>
peer <MCPeerID: 0x6000004442b0 DisplayName = theSERVER> didChangeState: connecting
peer <MCPeerID: 0x6000004442b0 DisplayName = theSERVER> didChangeState: connected
xxdidReceive color SLOT|0|<MCPeerID: 0x600002cdd360 DisplayName = theSERVER>
xxdidReceive color SLOT|1|<MCPeerID: 0x28075ba40 DisplayName = iPad>
xxdidReceive color SLOT|2|<MCPeerID: 0x280757bd0 DisplayName = iPad>
xxdidReceive color SLOT|3|<MCPeerID: 0x600002ccc0f0 DisplayName = theSERVER>
xxdidReceive color SLOT|4|<MCPeerID: 0x600002cdb9b0 DisplayName = iPad>
didReceiveInvitationFromPeer <MCPeerID: 0x600000454980 DisplayName = theSERVER>
didReceiveInvitationFromPeer <MCPeerID: 0x600000454980 DisplayName = theSERVER>

these indicate it connected to another peer named “theSERVER”… there is NO SUCH device. Earlier in the day I DID have an instance that identified itself as such, but that was removed, and the code deleted. I have even rebooted ALL the devices (mac, Ipad and iPhone)

The instance named “iPAD” was also from a since removed instance (Mac running in iOS mode)

The lines with “xxxdidRecieve” were also deleted hours ago.

How can I find an kill these invisible (yet responsive instances)… like I said, I have rebooted everything, Activity monitor doesn’t seem to show them

Have these all been run on the simulators ?
Maybe that sim needs to be restarted - not just the mc its on - since they retain state ?

I have run the app (the ones with invalid names, and newer versions) on a real mac, a real iphone, a real ipad, and various simulator devices.

I have shutdown everything, right now there is no simulator running, the real iphone and ipad are powered off, the app is running as “My Mac (designed for iPad)” (one instance ONLY)

and those rogue processes are responding to invite requests, as well as sending their init messages

So the ONLY place these rogue processes can exist is somewhere on the MAC. I have rebooted Xcode, rebooted the entire computer and yet they still persist.

I even went into Activity monitor and shutdown any BT related process…

I changed the “serviceType” to another ID… and those rogues don’t show up… which makes sense.
changing it back however, the rogues return

weird … makes me wonder if somehow this get registered at the OS level and it retains them or knowledge about them

I dont know much about this stuff to be of any use so this is just speculation

I would have thought that would NOT be the case since these sessions should be fluid, coming and going based on the designated app, and other devices. If a device “goes away” its connection should as well. I have changed the ServiceID so I have a clean instance to work with, and this one is behaving exactly as I would expect. If I connect two (or more devices) and then terminate the app on one of them, the others get a notification that “that device has left the building”

Thats my expectation as well
Weird but hard to know what IS reporting those rogue sessions as still present

Could it have anything to do with the ip routing table being cached. I don’t use a Mac anymore so can’t check but do remember from my unix days that the iptable would cache things and old names would show up because the mac address and IP was the same.