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

Add support for HTTP/1.1 and random non-responsive devices #197 #214

Closed
wants to merge 1 commit into from

Conversation

bdraco
Copy link
Contributor

@bdraco bdraco commented Dec 2, 2019

Homekit needs the headers and content sent
in a single write call or it will randomly
get connection reset by peer which leads
to iOS stalling and devices showing up
as non-responsive.

Additionally we avoid connection resets
by draining any incoming data from the buffer
when we close the connection.

Without HTTP/1.1 keep-alives, 50+ devices
would cause a bridge to timeout or devices
to go non-responsive because homekit would
have to make a new connection to get / put
for each device. With HTTP/1.1 it can avoid
all of this overhead

After this change, devices in homekit on
the bridges with > 80 devices were
now immediately responsive in testing.

Homekit needs the headers and content sent
in a single write call or it will randomly
get connection reset by peer which leads
to iOS stalling and devices showing up
as non-responsive.

Additionally we avoid connection resets
by draining any incoming data from the buffer
when we close the connection.

Without HTTP/1.1 keep-alives, 50+ devices
would cause a bridge to timeout or devices
to go non-responsive because homekit would
have to make a new connection to get / put
for each device.  With HTTP/1.1 it can avoid
all of this overhead

After this change, devices in homekit on
the bridges with > 80 devices were
now immediately responsive in testing.
@codecov-io
Copy link

codecov-io commented Dec 2, 2019

Codecov Report

Merging #214 into dev will decrease coverage by 0.66%.
The diff coverage is 37.5%.

@@            Coverage Diff             @@
##              dev     #214      +/-   ##
==========================================
- Coverage   60.97%   60.31%   -0.67%     
==========================================
  Files          16       16              
  Lines        1694     1706      +12     
  Branches      175      176       +1     
==========================================
- Hits         1033     1029       -4     
- Misses        622      638      +16     
  Partials       39       39
Impacted Files Coverage Δ
pyhap/hap_server.py 32.79% <37.5%> (-1.65%) ⬇️

@bdraco bdraco mentioned this pull request Dec 2, 2019
@bdraco
Copy link
Contributor Author

bdraco commented Dec 2, 2019

I think I can simplify this a bit more. Will resubmit later

@bdraco bdraco closed this Dec 2, 2019
@bdraco
Copy link
Contributor Author

bdraco commented Dec 7, 2019

Replaced with #216

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

Successfully merging this pull request may close these issues.

2 participants