<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>A good reading&nbsp;</div><div><br></div><div><a href="https://github.com/robbiehanson/CocoaAsyncSocket">https://github.com/robbiehanson/CocoaAsyncSocket</a></div><div><br></div><div>Usable In Swift, even if the umbrella module did not work for me, I had to compile it in my own workspace to use it in swift code</div><div><br></div><div>Regards&nbsp;<br><br><div>Gérard&nbsp;</div></div><div><br>Le 3 mai 2016 à 21:17, Tyler Cloutier via swift-users &lt;<a href="mailto:swift-users@swift.org">swift-users@swift.org</a>&gt; a écrit&nbsp;:<br><br></div><blockquote type="cite"><div><meta http-equiv="Content-Type" content="text/html charset=utf-8"><br class=""><div><blockquote type="cite" class=""><div class="">On May 3, 2016, at 12:14 PM, Jens Alfke &lt;<a href="mailto:jens@mooseyard.com" class="">jens@mooseyard.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On May 1, 2016, at 11:48 AM, Tyler Fleming Cloutier via swift-users &lt;<a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><span style="font-family: Alegreya-Regular; font-size: 15px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">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. </span></div></blockquote><div class=""><br class=""></div><div class="">I think libdispatch would be the better choice, since it’s what’s going to be used in Swift’s standard library going forward.</div><br class=""><blockquote type="cite" class=""><div class=""><span style="font-family: Alegreya-Regular; font-size: 15px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">However, libuv has many additional features for setting up TCP connections and other networking constructs.</span><br style="font-family: Alegreya-Regular; font-size: 15px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""></div></blockquote></div><br class=""><div class="">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&nbsp;dispatch_io_t from the FD. It should just take a couple of lines of code.</div></div></div></blockquote><div><br class=""></div><div>Indeed!</div><div><br class=""></div><div><a href="https://github.com/TheArtOfEngineering/Edge/blob/master/Sources/TCP.swift" class="">https://github.com/TheArtOfEngineering/Edge/blob/master/Sources/TCP.swift</a></div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""></div><div class="">—Jens</div></div></div></blockquote></div><br class=""></div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>swift-users mailing list</span><br><span><a href="mailto:swift-users@swift.org">swift-users@swift.org</a></span><br><span><a href="https://lists.swift.org/mailman/listinfo/swift-users">https://lists.swift.org/mailman/listinfo/swift-users</a></span><br></div></blockquote></body></html>