Hello!
I am using a NETransparentProxy and I need to manage multiple NEAppProxyFlow.
I am dealing with hundreds / thousands connections, so the one-thread-per-connection approach is really not feasible.
Regarding raw bsd sockets, I know multiple ways of achieving good results when managing a large number of sockets using:
poll()
kqueue
SwiftNIO library
but I am struggling to find a way to do something similar with flows.
My current "solution" is to create a new Task.detached for each new connection and have this Task 'block' on readData / readDatagrams.
It works for low numbers of connections but it does not scale well when the number of connections increases.
Is there a way to achieve a similar result as poll() for sockets for flows?
Otherwise, is there a way to make my current solution work? (even though I don't think it is able
to scale well)
I can provide more details about the architecture if needed, or code snippets.
Thank you!!