mcorega / MySqlSwiftNative

MySQL Swift Native Driver
Other
112 stars 45 forks source link

driver embedded in app cannot open connection #31

Open drwo opened 6 years ago

drwo commented 6 years ago

Thanks for developing this driver. It will be a big boon to my development efforts if I can get it working, to which see:

I have successfully downloaded and built the driver using Xcode version 9.0.1, High Sierra 10.13.3. All of the tests work fine, I can connect to SQL servers locally and remotely, use databases, etc.

When I embed the driver in a Coca app and attempt to open a connection to "localhost" an exception is thrown that the operation is not permitted:

applicationDidFinishLaunching 2018-01-11 16:10:19.661863-0500 CellarMasters[1627:44425] dnssd_clientstub ConnectToServer: connect()-> No of tries: 1 2018-01-11 16:10:20.662145-0500 CellarMasters[1627:44425] dnssd_clientstub ConnectToServer: connect()-> No of tries: 2 2018-01-11 16:10:21.662855-0500 CellarMasters[1627:44425] dnssd_clientstub ConnectToServer: connect()-> No of tries: 3 2018-01-11 16:10:22.663276-0500 CellarMasters[1627:44425] dnssd_clientstub ConnectToServer: connect() failed path:/var/run/mDNSResponder Socket:11 Err:-1 Errno:1 Operation not permitted connectFailed("Operation not permitted") writeFailed("Socket is not connected") applicationWillTerminate

Any ideas or suggestions much appreciated.

Thanks, Dr. Wo

rodyager commented 6 years ago

Looks like App Sandbox has got in your way. In your project capabilities you need to select Network: Outgoing connections (Client).