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

Client does not discover provider that was started before the client #188

Open
chjan opened this issue May 14, 2019 · 2 comments
Open

Client does not discover provider that was started before the client #188

chjan opened this issue May 14, 2019 · 2 comments

Comments

@chjan
Copy link

chjan commented May 14, 2019

I have the exact same problem that someone had in 2010 (SourceForge), hence I quote that text below.

Question: What is the best way to make sure a client will always discover a service provider ON THE SAME DEVICE that was started BEFORE the client? (Starting client before provider works; the provider is discovered. Also, when provider is at another ip, it is resolved independent of what was started first).

Quote from 2010: "i have two processes on the SAME machine, the service provider and the service client. both start JmDNS on the host adress in the WLAN interface. when i am starting the service provider first, the client does not find the services, starting the client first the services are discovered"

@theonlytechnohead
Copy link

#138 (comment) might help you
I fixed it by changing how I got the local address (on Android) to properly get the IP, e.g. 192.168.1.xxx instead of 127.0.0.1

@ViToni
Copy link
Contributor

ViToni commented Dec 1, 2020

@chjan These are two quite different use cases.

  1. Other Service starts AFTER the client: Every service has to announce itself so you'll get the announcement. Everything should be fine.
  2. Other Service starts BEFORE the client: Since the service knows "everything is fine" since its announcement was succesful and not challenged by anyone it just sits there and waits to be queried. So when starting the client it has to query for the services it is interested in. Otherwise one would have to wait for some other party in the network to try to refresh its cache and then get the service information as a side effect.

When you client works as in 2) both cases work.

Feel free to take a look at: https://github.com/ViToni/jmdns-examples for examples

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

No branches or pull requests

3 participants