Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xamarin.iOS: Add workaround for new restrictions in iOS 14.5+ #212

Merged
merged 4 commits into from
Aug 16, 2021

Conversation

rcinge
Copy link

@rcinge rcinge commented Aug 10, 2021

Uses iOS NSNetServiceBrowser/NSNetService instead of BSD sockets. Some items visible using raw sockets are not available in NSNetServiceBrowser and friends. Also, by definition, this code can only browse services it requests permission to see via Info.plist entries.

Copy link
Collaborator

@clairernovotny clairernovotny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general looks good. Can you please ensure code styles are followed (use of var preferred, for example).

Biggest thing needed here are docs in the Readme so that iOS users know what to do and what to expect.

{
NSNetService netService = null;

if (sender is NSNetService)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this could be simplified to be sender is NSNetService netService

…ot have to provide values; exposes iOS mDNS domain name search; NSNetService.Resolve timeout is same as ScanTime (was hardcoded), provide was for library caller to force-disable the workaround, even on iOS 14.5+; added documentation
@rcinge
Copy link
Author

rcinge commented Aug 12, 2021

OK, added some documentation. In doing so, realized what a PITA it would be to duplicate and maintain the Info.plist entries in code... so added code to read the Info.plist internally. This led to supporting non .local domain names, which led to querying the network for active domain names. All this is library-consumer controlled, so complexity is only for those who need it.

@clairernovotny clairernovotny merged commit 41c8c5d into novotnyllc:main Aug 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants