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

Question: Is it possible to avoid binding a UDP socket? #263

Closed
kjvalencik opened this issue Dec 1, 2020 · 4 comments
Closed

Question: Is it possible to avoid binding a UDP socket? #263

kjvalencik opened this issue Dec 1, 2020 · 4 comments
Labels
enhancement Make a feature better

Comments

@kjvalencik
Copy link

let wake_socket = UdpSocket::bind("127.0.0.1:0")?;

It might be outside the scope of this project, but I'm attempting to use isahc in a macOS app with sandboxing enabled. Since isahc creates a UDP socket, it requires the server entitlement even when I only need to make client requests.

It would be nice if this could be achieved without a socket or if concurrency was feature flagged.

@sagebind
Copy link
Owner

sagebind commented Dec 1, 2020

Thanks for filing an issue! I'm always happy to accept feedback such as this. The use of UDP is unfortunate here, as it is the only good cross-platform way to interrupt a select(2) call which is how Isahc does its I/O asynchronously. We could use a UNIX pipe instead of UDP on Linux and macOS without too much trouble though.

That said, I'm already working on getting rid of the UDP socket completely in #243, by replacing select(2) altogether with a different I/O driver that supports wakeups natively. I'm not sure what the timeline on that PR is though since finicky IOCP bits on Windows has been causing some trouble so far, though hopefully it will be ready by the end of the year.

@sagebind sagebind added the enhancement Make a feature better label Dec 1, 2020
@kjvalencik
Copy link
Author

kjvalencik commented Dec 1, 2020

@sagebind That's awesome! isahc is fantastic and I would love to be able to use it in my cross platform app. Unfortunately, requiring the server entitlement on Apple isn't an option because it would be denied by the app store. Let me know if there's anything I can do to help. 😁 Cheers!

@sagebind
Copy link
Owner

This is now fixed in the 1.2.0 release! Sorry about the delay, as this required a significant refactoring. Better late than never I suppose?

@kjvalencik
Copy link
Author

Awesome! Thanks so much @sagebind!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Make a feature better
Projects
None yet
Development

No branches or pull requests

2 participants