How to restart NWListener once it was cancelled?
问题 I would like to receive some data via UDP in an endless loop until the user cancels the data receiving. I created an NWListener , and set it up. It receives data as expected. However once I call .cancel() on my NWListener it changes the state to .cancelled but afterwards I have no chance to restart the listening process again. It blocks somehow the port. I would be able to restart it on another port, but this is not what I want to do. On the same port it ends up in this error message: 2020-02