NSPOSIXErrorDomain when binding to socket on macOS 10.12
I believe it's the generated Xcode entitlements that prevent from binding. I changed those values to false
and now the bind works
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<false/>
<key>com.apple.security.files.user-selected.read-only</key>
<false/>
</dict>
</plist>
Creating and binding socket on Mac OS Hight Sierra
The problem was that the application was sandboxed and did not have the Network: Incoming Connections entitlement. That entitlement can be added in Xcode under the App Sandbox details in the Capabilities tab of the target settings.
Related Topics
How to Make Player Move to Opposite Side While Is in a Path
Get Color of Point in a Skscene Swift
Can a Subclass Override a Function and Make More Restrictive Return
Subscript of a Struct Doesn't Set Values When Created as an Implicitly Unwrapped Optional
Workarounds for Generic Variable in Swift
Swift String Permutations Allowing the Same Strings
How to Keep a Reference to Another Object in the Parameters of the Class
Cloudkit Ckqueryoperation Doesn't Get All Records
Differenceand Purpose of Auto and Escaping Closure in Swift
Swift Progress View with Nstimer
Accurately Get a Color from Pixel on Screen and Convert Its Color Space
Swift 4 - Avfoundation Screen and Audio Recording Using Avassetwriter on MAC Os - Video Frozen
How to Add Uivibrancyeffect to an Existing Uilabel ( Iboutlet )
Satisfying Expressiblebyarrayliteral Protocol
Binding 2 Properties (Observe) Using Keypath