-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
158 additions
and
66 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
defmodule ExWebRTC.ICETransport do | ||
@moduledoc false | ||
|
||
# module implementing this behaviour | ||
@type t() :: module() | ||
|
||
@callback start_link(ExICE.ICEAgent.role(), Keyword.t()) :: {:ok, pid()} | ||
@callback add_remote_candidate(pid(), candidate :: String.t()) :: :ok | ||
@callback end_of_candidates(pid()) :: :ok | ||
@callback gather_candidates(pid()) :: :ok | ||
@callback get_local_credentials(pid()) :: {:ok, ufrag :: binary(), pwd :: binary()} | ||
@callback restart(pid()) :: :ok | ||
@callback send_data(pid(), binary()) :: :ok | ||
@callback set_remote_credentials(pid(), ufrag :: binary(), pwd :: binary()) :: :ok | ||
end | ||
|
||
defmodule ExWebRTC.DefaultICETransport do | ||
@moduledoc false | ||
|
||
@behaviour ExWebRTC.ICETransport | ||
|
||
alias ExICE.ICEAgent | ||
|
||
@impl true | ||
defdelegate add_remote_candidate(pid, candidate), to: ICEAgent | ||
@impl true | ||
defdelegate end_of_candidates(pid), to: ICEAgent | ||
@impl true | ||
defdelegate gather_candidates(pid), to: ICEAgent | ||
@impl true | ||
defdelegate get_local_credentials(pid), to: ICEAgent | ||
@impl true | ||
defdelegate restart(pid), to: ICEAgent | ||
@impl true | ||
defdelegate send_data(pid, data), to: ICEAgent | ||
@impl true | ||
defdelegate set_remote_credentials(pid, ufrag, pwd), to: ICEAgent | ||
@impl true | ||
defdelegate start_link(role, opts), to: ICEAgent | ||
end |
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
Oops, something went wrong.