-
Notifications
You must be signed in to change notification settings - Fork 50
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
Rewrite network stack to Swift NIO (armv7 support!) #68
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
95c8cdc
to
9814d30
Compare
This was referenced Dec 15, 2018
Why did HAP not run on the Pi before ? Is BlueSocket incompatible ? |
Swift has various 32 bit incompatibilities, and as a result it would segfault a lot; either during compilation or at runtime. There’s a community build version for 4.1.3 that’s much better. Maybe it would even run master branch, I haven’t checked.
… Op 18 dec. 2018 om 06:56 heeft Guy Brooker ***@***.***> het volgende geschreven:
Why did HAP not run on the Pi before ? Is BlueSocket incompatible ?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
This was referenced Jan 8, 2019
tgu
reviewed
Jan 22, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The current network stack uses BlueSocket, which operates very directly on sockets, which means we have to build our own eventing mechanisms. Swift has seen the release of Swift NIO, an event-driven network application framework. Incorporating NIO means that we outsource a lot of the socket handling and eventing.
This PR incorporates a small portion of Vapor's HTTP handler, to parse the raw HTTP fields received from NIO.
The great thing about this rewrite, is that I'm finally able to run HAP on my Raspberry Pi3 (Stretch) on the community build of Swift 4.1.3.
This PR is not finished, there might be some cases that are not yet handled. I'm currently running this in my home to identify gaps, but so far seems to work like a charm. I plan on doing additional refactors to clean up, but maybe I'll leave that for a future PR.
Todo before merging:
pairings()
)