[swift-corelibs-dev] Cannot call CFStreamCreatePairWithSocket on Linux

Philippe Hausler phausler at apple.com
Tue Mar 15 12:52:41 CDT 2016


CFNetwork is a separate dynamic library that is lazily loaded via dlopen. So we don’t need to have CFNetwork present to build.

> On Mar 15, 2016, at 10:51 AM, Max Howell <max.howell at apple.com> wrote:
> 
> For interests sake, how come it could link?
> 
>> You are correct, those symbols are from CFNetwork which are not yet implemented on linux targets. CFStream is implemented but CFSocketStream is not implemented in swift-corelibs-foundation. It could be technically reasonable to port the open source (very old) CFNetwork to linux. However I am fairly certain that would take a bit of work to get up and running; especially the Security framework portions.
>> 
>>> On Mar 15, 2016, at 7:54 AM, Pushkar N Kulkarni via swift-corelibs-dev <swift-corelibs-dev at swift.org <mailto:swift-corelibs-dev at swift.org>> wrote:
>>> 
>>> 
>>> Hello all, 
>>> 
>>>  While attempting a simple Swift client-server program on Linux using CFSocket, I tried to create CFReadStream and CFWriteStream instances using CFStreamCreatePairWithSocket(_:_:_:_). The program compiles and links but it crashes with this:
>>> 
>>> 2016-03-15 10:30:17.791 Client[21389:5a501740] CoreFoundation: failed to dynamically link symbol _CFSocketStreamCreatePair
>>> 
>>> 2016-03-15 10:30:17.791 Client[21389:5a501740] CoreFoundation: failed to dynamically link symbol _CFErrorCreateWithStreamError
>>> 
>>> 2016-03-15 10:30:17.791 Client[21389:5a501740] CoreFoundation: failed to dynamically link symbol _CFStreamErrorFromCFError
>>> 
>>> 
>>> 
>>> 
>>> 
>>> I see that these symbols are dynamically linked from CFNetwork which, I guess, doesn't exist on Linux (so there is no lookup for these symbols on Linux). 
>>> 
>>> Does this qualify to be a CFStream limitation on Linux?
>>> 
>>> Thanks in advance for your time!
>>> 
>>> Pushkar N Kulkarni,
>>> IBM Runtimes
>>> 
>>> Simplicity is prerequisite for reliability - Edsger W. Dijkstra
>>> 
>>> 
>>> _______________________________________________
>>> swift-corelibs-dev mailing list
>>> swift-corelibs-dev at swift.org <mailto:swift-corelibs-dev at swift.org>
>>> https://lists.swift.org/mailman/listinfo/swift-corelibs-dev <https://lists.swift.org/mailman/listinfo/swift-corelibs-dev>
>> 
>> _______________________________________________
>> swift-corelibs-dev mailing list
>> swift-corelibs-dev at swift.org <mailto:swift-corelibs-dev at swift.org>
>> https://lists.swift.org/mailman/listinfo/swift-corelibs-dev
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-corelibs-dev/attachments/20160315/886c4af4/attachment.html>


More information about the swift-corelibs-dev mailing list