Hi, i work on some application which should send data between devices, I implement that in Network Framwork instead of socket.
Everything works like it should, except one situation which i do not understand correctly.
When i open NWConnection to some endpoint, i can observe states - all works fine from setting uoo to ready.
I can send data between, without problems.
Now i want to solve in nice way situation when one side of connection is closed - manually or by an issue.
I do close connection by cancelCurrentEndpoint - there are no other endpoints on that connection - so as i expect State should change to cancelled, but it goes to failed on the device i close it with information that network is down.
I don't undersand why nothing happens on the endpoint this connection - no StateUpdate
When i use cancel() method, it works like expected - on my side of connection statusChange to cancelled.
I can make some code to send to all devices information about closing connection, but it is not solution i want.
Have someone got that issue and explain how those cancel - cancelEndPoint method works, on Apple Documentation there is nothing to read.