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

JmDNS stops seeing other services after adding setText() for his ServiceInfo #187

Open
vhuty opened this issue May 4, 2019 · 0 comments

Comments

@vhuty
Copy link

vhuty commented May 4, 2019

JmDNS stops seeing other services after adding a map with setText() for ServiceInfo and further registration, like this:

private final String TYPE = "_app._tcp.local.";
private final String SERVICE_NAME = "Client";
private final int PORT = 49152;

private JmDNS jmDNS;
private ServiceInfo mServiceInfo;
private ServiceListener mServiceListener;

jmDNS = JmDNS.create(getCurrentInetAddress());
mServiceInfo = ServiceInfo.create(TYPE, SERVICE_NAME, PORT, SERVICE_NAME);

    Map<String, String> serviceInfoMap = new LinkedHashMap<String, String>(){{
        put(serviceInfoTags.TYPE_TAG.toString(), deviceTypes.PHONE.toString());
        put(serviceInfoTags.DEVICE_NAME_TAG.toString(), DEVICE_NAME);
    }};

mServiceInfo.setText(serviceInfoMap);
jmDNS.registerService(mServiceInfo);

He sees himself at the time of discovery, but not others with this method. How to fix it?

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

1 participant