-
Notifications
You must be signed in to change notification settings - Fork 14
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 PeerConnection state machine #20
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #20 +/- ##
==========================================
+ Coverage 82.32% 84.78% +2.46%
==========================================
Files 10 10
Lines 430 447 +17
==========================================
+ Hits 354 379 +25
+ Misses 76 68 -8
Continue to review full report in Codecov by Sentry.
|
743607b
to
125eb5d
Compare
lib/ex_webrtc/peer_connection.ex
Outdated
defp next_conn_state(ice_state, dtls_state) when ice_state == :failed or dtls_state == :failed, | ||
do: :failed | ||
|
||
defp next_conn_state(ice_state, dtls_state) when ice_state == :new and dtls_state == :new, | ||
do: :new |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
defp next_conn_state(ice_state, dtls_state) when ice_state == :failed or dtls_state == :failed, | |
do: :failed | |
defp next_conn_state(ice_state, dtls_state) when ice_state == :new and dtls_state == :new, | |
do: :new | |
defp next_conn_state(:failed, :failed), do: :failed | |
defp next_conn_state(:new, :new), do: :new |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't do this with the first one becasue of or
.
I can do
defp next_conn_state(:failed, _), do: :failed
defp next_conn_state(_, :failed), do: :failed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, right! Although, I think I still prefer the version with pattern matching.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
lib/ex_webrtc/peer_connection.ex
Outdated
defp next_conn_state(ice_state, dtls_state) | ||
when ice_state in [:connected, :completed] and dtls_state in [:connected], | ||
do: :connected |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
defp next_conn_state(ice_state, dtls_state) | |
when ice_state in [:connected, :completed] and dtls_state in [:connected], | |
do: :connected | |
defp next_conn_state(ice_state, :connected) | |
when ice_state in [:connected, :completed], do: :connected |
No description provided.