Nsposixerrordomain When Binding to Socket on MACos 10.12

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



Leave a reply



Submit