Skip to content

Conversation

@georgeday-firefly
Copy link

Fixes crash:

** (MatchError) no match of right hand side value: {:error, :closed}
    (ex_ice 0.14.0) lib/ex_ice/priv/ice_agent.ex:947

When TURN sockets close unexpectedly during allocation refresh, transport_module.send/3 returns {:error, :closed}, causing the above MatchError that terminates WebRTC streams.

This PR wraps the send calls in case statements to handle errors gracefully by closing the transaction/candidate and cleaning up state.

Handle {:error, :closed} when transport_module.send fails during
TURN allocation refresh. Previously caused MatchError crashes that
terminated WebRTC streams.

Changes:
- Wrap transport_module.send calls in case statements
- Gracefully close transactions/candidates on socket errors
- Add debug logging for troubleshooting

Fixes crashes at lines 947 and 976 when TURN sockets close unexpectedly.
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.

1 participant