-
Notifications
You must be signed in to change notification settings - Fork 0
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
Start mDNS only once per app #22
Conversation
lib/mdns.ex
Outdated
|
||
@spec query(pid(), String.t()) :: :ok | ||
def query(from, address) do | ||
GenServer.cast(__MODULE__, {:query, from, address}) |
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.
we usually use send
Mdns.Client.query(address) | ||
state = put_in(state, [:mdns_queries, address], {candidate, stream_id, component_id}) | ||
{:reply, :ok, state} | ||
if Application.get_env(:ex_libnice, :mdns, true) do |
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.
a word of docs about this would be useful
0759d21
to
a2c302c
Compare
lib/ex_libnice_app.ex
Outdated
```elixir | ||
config :ex_libnice, mdns: false | ||
``` | ||
""" |
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.
I think that readme would be a better place for this
lib/mdns.ex
Outdated
[from] | ||
|
||
pids -> | ||
pids ++ [from] |
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.
pids ++ [from] | |
[from | pids] |
lib/mdns.ex
Outdated
end | ||
|
||
@impl true | ||
def handle_cast({:query, from, address}, state) do |
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.
If we're send
ing this, we should handle it in handle_info
. Quite surprised it works this way
a5c12df
to
4d4f25e
Compare
…ocs improvements. Add `ex_libnice` subdirectory.
No description provided.