Is there a concept to stop advertising the server once a connection has been made?
Opened this issue · 1 comments
pennstump commented
If not, how might you accomplish that? I have tried stopping the NWListener, but that did not stop a Server from showing up to other clients.
saagarjha commented
To advertise you call Connection.advertise(forServiceType:name:key:)
, which hands you back an AsyncStream
of clients that want to connect. If you stop iterating over the results (for example by breaking out the loop you're consuming it with) then the cleanup for that should stop advertising–at least, in theory. Let me know if that's what you're looking for.