Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable watchOS in the Podspec #87

Closed
JacopoMangiavacchi opened this issue Sep 21, 2017 · 2 comments
Closed

Disable watchOS in the Podspec #87

JacopoMangiavacchi opened this issue Sep 21, 2017 · 2 comments

Comments

@JacopoMangiavacchi
Copy link

I saw watchOS is a supported platform on the pod and I tried to use it on a watchOS project but unfortunately I discovered Posix/BSD/Darwin sockets are not supported on real Apple Watch devices.

Sockets only works on simulator.

Basically when the BlueSocket initializer [Socket.swift init()] try to create a Darwin.socket handle on a real device it get a SOCKET_INVALID_DESCRIPTOR and then throw an exception.

Indeed all Foundation/iOS APIs based on Posix/BSD/Darwin sockets (i.e. NSURLSessionStreamTask, NSStream and CFSocketStream) are flagged as __WATCHOS_PROHIBITED on watchOS.

NSURLSession (for HTTP) is the only network API available on watchOS

The simulator works because it doesn’t apply sandbox restrictions.

Jacopo Mangiavacchi

@JacopoMangiavacchi
Copy link
Author

If you need more context info I was trying to create an .ipv4 socket on datagram/udp on watchOS 4.0

try Socket.create(family: .inet, type: .datagram, proto: .udp)

@billabt
Copy link
Collaborator

billabt commented Sep 21, 2017

Fixed in the latest release. Thanks for the report.

@billabt billabt closed this as completed Sep 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants