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

added disconnect listener #40

Merged
merged 5 commits into from
Nov 27, 2022
Merged

added disconnect listener #40

merged 5 commits into from
Nov 27, 2022

Conversation

FieryRMS
Copy link
Contributor

@FieryRMS FieryRMS commented Nov 25, 2022

fixes #38
self.__video_socket.recv returns an empty byte string when device gets disconnected.
I also added a new event EVENT_DISCONNECT that is called when disconnect happens.

raw_h264 = self.__video_socket.recv(0x10000)

scrcpy/core.py Outdated Show resolved Hide resolved
scrcpy/core.py Outdated Show resolved Hide resolved
scrcpy/core.py Outdated Show resolved Hide resolved
scrcpy/core.py Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Nov 27, 2022

Codecov Report

Merging #40 (ca55a2b) into main (f94749b) will decrease coverage by 0.17%.
The diff coverage is 85.71%.

@@            Coverage Diff             @@
##             main      #40      +/-   ##
==========================================
- Coverage   98.34%   98.17%   -0.18%     
==========================================
  Files           3        3              
  Lines         543      547       +4     
==========================================
+ Hits          534      537       +3     
- Misses          9       10       +1     
Flag Coverage Δ
unittests 98.17% <85.71%> (-0.18%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
scrcpy/core.py 93.23% <83.33%> (-0.62%) ⬇️
scrcpy/const.py 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@leng-yue leng-yue merged commit 54bb7ac into leng-yue:main Nov 27, 2022
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.

[Help] How to attach a callback to a disconnect event?
3 participants