My NEDNSProxyProvider subclass basically does this for each incoming UDPFLow:open()while moreDataComing { read() filter() // modify EDNS0 write()}closeWrites()closeReads()What I sometimes see though is that after the first read/write sequence, iOS appears to close the UDPFlow for me. I see these in the logs:default 16:12:09.186963 -0800 MyProxy (2552644817): Closing reads, not closed by plugindefault 16:12:09.187134 -0800 MyProxy (2552644817): Closing writes, not sending closeThen later when I attempt to close the flow explicitly I get:default 16:12:09.273912 -0800 MyProxy writeDatagrams finished with error: Optional(Error Domain=NEAppProxyFlowErrorDomain Code=1 "The operation could not be completed because the flow is not connected" UserInfo={NSLocalizedDescription=The operation could not be completed because the flow is not connected})Sometimes I also seeerror 17:01:55.396243 -0800 MyProxy (3009813469): flow is closed for writes, cannot write 111 bytes of dataI'm not 100% sure if this is actually a problem or not as far as the actual functioning of the proxy goes, but I'd like to understand why it's happening. Is there something I'm doing or not doing that's causing iOS (or CFNetwork or whatever) to close the socket before I can do so explicitly? My class has a strong reference to the NEAppProxyUDPFlow object so it's not like it's getting deallocated early or anything.
8
0
4.9k