On 21 Aug 2018, at 10:09, Mike Crawford <mdcrawf...@gmail.com> wrote:
> 
>> drag C developers away from the POSIX sockets API
> 
> Don't be dismayed if you're not happy with NIO:
> 
> There are numerous APIs that do such dragging, for example the
> ADAPTIVE Communications Environment (ACE):
> 
>   http://www.dre.vanderbilt.edu/~schmidt/ACE.html 
> <http://www.dre.vanderbilt.edu/~schmidt/ACE.html>
> 
> Mozilla's NetScape Portable Runtime, The Electric Magic Company's
> ZooLib is C++ and MIT Licensed:
> 
>   http://www.em.net/portfolio/2000/12/zoolib.html 
> <http://www.em.net/portfolio/2000/12/zoolib.html>
> 
> I expect there are many others.

One of the problems with many of those libraries is that they tend to insist 
that your software use their own event loop implementation(s). Admittedly it’s 
been a while since I looked at ACE (for example), but NIO is at least going to 
be using the same mechanisms that you’d use anyway in a macOS or iOS 
application.

Anyway, when looking at an async networking library, you want to check that it 
will integrate nicely with the set of platforms you care about, using the kind 
of event dispatch you require in your application. So, for instance, it’s not 
so good on macOS or iOS if its event dispatcher is based on select(), (e)poll() 
or kqueue() because what you really want on macOS/iOS is for the event dispatch 
to go via CFRunLoop; if it doesn’t, you’ll end up having to use threading to 
run the network library’s event loops on background threads, which for an async 
networking library kind of defeats the point IMO. (Of course, you may want to 
have event loops running in threads or thread pools for performance reasons, 
but one of the real benefits of async networking libraries is that you can use 
them from the main thread in your GUI code.)

Likewise, on Windows you’re going to want something that uses 
MsgWaitForMultipleObjectsEx() or similar, and on Linux you definitely want 
epoll() support.

Kind regards,

Alastair.

--
http://alastairs-place.net

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Reply via email to