> On May 3, 2016, at 12:14 PM, Jens Alfke <j...@mooseyard.com> wrote:
> 
> 
>> On May 1, 2016, at 11:48 AM, Tyler Fleming Cloutier via swift-users 
>> <swift-users@swift.org <mailto:swift-users@swift.org>> wrote:
>> 
>> libuv and libdispatch overlap on functionality quite a bit, but libdispatch 
>> has the benefit of using a block API instead of a function pointer API, 
>> which makes memory management easier in Swift.
> 
> I think libdispatch would be the better choice, since it’s what’s going to be 
> used in Swift’s standard library going forward.
> 
>> However, libuv has many additional features for setting up TCP connections 
>> and other networking constructs.
> 
> The dispatch_io API lets you use libdispatch with file descriptors, so 
> working with TCP would just involve making the usual system calls to open the 
> connection and then creating a dispatch_io_t from the FD. It should just take 
> a couple of lines of code.

Indeed!

https://github.com/TheArtOfEngineering/Edge/blob/master/Sources/TCP.swift

> 
> —Jens

_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users

Reply via email to