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

UDPClient always fails with unknownError #162

Open
MrJanssen opened this issue Jan 23, 2019 · 6 comments
Open

UDPClient always fails with unknownError #162

MrJanssen opened this issue Jan 23, 2019 · 6 comments

Comments

@MrJanssen
Copy link

The following code always fails to send a UDP message,
with console output:
"Client failed to send message to server: unknownError"

let udpClient = UDPClient(address: "127.0.0.1", port: 12033)  

switch udpClient.send(string: "Hello") {
case .success:
    print("Client sent message to server.")
case .failure(let error):
     print("Client failed to send message to server: \(error)")
}

udpClient.close()

Using Xcode 10.1 and Swift 4.2
macOS High Sierra 10.13.6

@nyx
Copy link

nyx commented Mar 3, 2019

I just figured this out - in your project's Capabilities settings ensure that the App Sandbox Network in and out (client and server) are enabled. 👍

@nyx
Copy link

nyx commented Mar 3, 2019

Using Xcode Version 10.1 (10B61)
Apple Swift version 4.2.1 (swiftlang-1000.11.42 clang-1000.11.45.1)
Target: x86_64-apple-darwin18.5.0
macOS Mojave 10.14.4 Beta (18E194d)

@rustymyers
Copy link

This helped me! Thanks!

@ilyamordasov
Copy link

ilyamordasov commented Nov 14, 2019

Does it work only with paid developer program? I do not see App sandbox in my capabilities

@rustymyers
Copy link

@ilyamordasov I checked the quick help on Xcode and it says "The Capability library shows only the capabilities available to the target type and your program membership. If you are not a member of the Apple Developer Program, the capabilities you can add are limited".

This might be one of those.
https://developer.apple.com/documentation/xcode/adding_capabilities_to_your_app

@ilyamordasov
Copy link

@rustymyers that's no good for me. ok, thanks :)

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

4 participants