Once I have the flow received in handleNewFlow I
I have passed the flow to the thread properly . is it like the flow has become invalid since my reads are on a separate thread ?
should I have to call any API to keep the flow alive ?
call openWithLocalEndpoint
create a thread in which I read through the local endpoint flow and send the data to server
return YES so to handle the flow .
I have passed the flow to the thread properly . is it like the flow has become invalid since my reads are on a separate thread ?
should I have to call any API to keep the flow alive ?
Most folks creating NetworkExtension providers are either use Swift or Objective-C with ARC. In those scenarios you don’t need to, indeed can’t, call -retain explicitly. Rather, you’re expected to maintain a strong reference to the flow while you’re using it.
How you do this depends on the structure of your code. It’s common for folks to have an object that tracks the state of a flow and, if you do that, you should store the flow in a strong property on that object and then, in your provider, maintain a reference to all of those objects in a dictionary, array or set.
If you are using Objective-C with manual retain/release then you may need to manually call -retain but in most cases that’s not necessary because of the approach I described in the previous paragraph.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"
How you do this depends on the structure of your code. It’s common for folks to have an object that tracks the state of a flow and, if you do that, you should store the flow in a strong property on that object and then, in your provider, maintain a reference to all of those objects in a dictionary, array or set.
If you are using Objective-C with manual retain/release then you may need to manually call -retain but in most cases that’s not necessary because of the approach I described in the previous paragraph.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"