On 22 Feb 2019, at 16:55, Neil Alexander <neilalexan...@neilalexander.eu> wrote:

> There is Cgo for that but it’s not exactly elegant

Wow, I’m quite surprised by that.  Based on my recent experience with Swift, I 
would have thought that good C integration was table stakes for a new language. 
 Interesting.

Anyway, a hard dependency on BSD Sockets is likely to cause more challenges 
down the line.  Apple is in the process of moving to a user space network 
stack, and the canonical interface to that stack is Network framework.  It’s 
hard to imagine BSD Sockets going away — so it will be supported as a 
compatibility API indefinitely — but it’s easy to imagine that cool new stuff 
will show up in Network framework rather than there.

Which isn’t to say that Network framework currently has all your networking 
needs covered.  For example, there’s a big hole where multicast support should 
be (r 26872068).  However, this reality makes it hard to argue for significant 
enhancements to BSD Sockets.

But all of that is about the future, and you have a decision to make right now. 
 Unfortunately I don’t see any good way forward:

* You can’t use Network framework because it doesn’t support multicast.

* There’s no supported way to enable peer-to-peer Wi-Fi with BSD Sockets.  You 
could probably reverse engineer the required secret sauce, but that’s not 
something I’d endorse.

* You might be able to make some progress by using NSNetService or Network 
framework to ‘prime’ peer-to-peer Wi-Fi enough to get your current code 
working.  However, that’s also not something I support, because if it works 
it’ll only work by an accident of the implementation.

                   *                   *                   *

What’s your intended distribution scope?  Is this something you’re creating for 
fun?  Or something you plan to deploy to a wide array of users?

Share and Enjoy
--
Quinn "The Eskimo!"                    <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (Macnetworkprog@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/macnetworkprog/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to