sockets-for-pcl
sockets-for-pcl copied to clipboard
Access Denied
I am getting some users with "Access Denied" error on ConnectAsync. I cannot repro the issue and I have no idea whats causing it. It seems the things in common are that they are using iPhone 6s, and on T-Mobile Cellular. Scrrenshot attached of the error.
Howdy.. haven't come across an error like this before. Remind me, are you using TCP or UDP sockets?
Does your application open many socket connections over time?
TCP. And yes, opens around 10-12 sockets all at the same time. Each on their on thread.
I think I found the issue. It appears that I am opening with an IPV6 address (not intended on my part!). I assume your libarary does not work with IPv6?
Interesting - I don't do anything to explicitly support or not support ipv6 - but I've had people in the past discuss adding support for it. No idea how big of a change it is the API and not enough bandwidth to explore it at the moment.. I was hoping it might 'just work', but it looks like that's not the case!
Hello David,
My app was rejected by app store because it does not work via IPv6 Wi-fi. On IPv4 Wi-Fi all works perfect. Therefor, I have setup an IPv6 Wi-Fi network using my mac as described here:
https://developer.apple.com/library/content/documentation/NetworkingInternetWeb/Conceptual/NetworkingOverview/UnderstandingandPreparingfortheIPv6Transition/UnderstandingandPreparingfortheIPv6Transition.html
The app makes a discovery to get knx interfaces (knx is a standard for building automation (knx.org)) available on a LAN.
Get all interfaces works: var networkInterface = CommsInterface.GetAllInterfacesAsync().Result.FirstOrDefault(_ => _.IpAddress == ipv4.ToString()); Join works: udpClient.JoinMulticastGroupAsync( RoutingConnector.DefaultMulticastAddress.ToString(), RoutingConnector.DefaultPort, networkInterface).Wait();
But the call
var sendTask = udpClient.SendMulticastAsync(searchRequest);
sendTask.Wait();
Throws the exception Exception in Connect: System.AggregateException: One or more errors occurred. ---> System.Net.Sockets.SocketException: No route to host at System.Net.Sockets.Socket.EndSend (IAsyncResult result) [0x0002d] in /Users/builder/data/lanes/3539/f37444ae/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/System/System.Net.Sockets/Socket.cs:2648
I assume the problem could be that the UdpClient uses the IPv4 address from the networkInterace object and has to use the IPv6 mapped address.
Best regards Wilhelm