Open jbgosselin opened 2 months ago
This isn't currently possible, but it is something we should be able to add. It's somewhat related to https://github.com/grpc/grpc-swift/issues/1913 which also requires more API for creating connections with NWConnections/NWListeners.
Thanks a lot for the fast answer !
Yes this looks similar than the mentioned issue.
We are looking forward this addition in the future 🙌
Just for understanding the change, would it be adding a ConnectionTarget
that would receive a NWConnection
?
What are you trying to achieve?
Hi grpc-swift team, I would like to be able to force a GRPC connection/call to happen on the cellular network only.
My best shot so far was to create a
NWConnection
withNWParameters.requiredInterfaceType
. But I can't find a way to either configure this with grpc-swift or being able to pass a NIO'sChannel
to the library.I see there is some wrappers around generating the NIO Channel here https://swiftinit.org/docs/grpc-swift/grpc/clientbootstrapprotocol, but it seems that I cannot call
withExistingNWConnection
on it https://swiftpackageindex.com/apple/swift-nio-transport-services/1.21.0/documentation/niotransportservices/niotsconnectionbootstrap/withexistingnwconnection(_:)Do you have some advice if this is currently possible, if so how to achieve this ? Otherwise, what would be the course of action to add the possibility to force the interface used ?
What have you tried so far?
Here is a code snippet to create a NIO Channel with such connection.
Thanks in advance !