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

serviceResolved called infinitely for a single service registration #220

Open
funkcjonusz opened this issue Feb 26, 2021 · 0 comments
Open

Comments

@funkcjonusz
Copy link

funkcjonusz commented Feb 26, 2021

Taking ServiceInfo using the following implementation causes the serviceResolved method to be called continuously(infinitely) for single service registration:
`

class SampleListener implements ServiceListener {

       @Override   
       public void serviceResolved(ServiceEvent event) {  
           String deviceInfo = (event.getDNS().getServiceInfo(event.getType(), event.getName())).getNiceTextString();  
                                     
           ...                  
       }             
    }  
    `

If I use the implementation shown below I see one or two calls of serviceResolved method for single service registration but only last one has proper string/message describing service
`
ServiceInfo serviceInfo = event.getInfo();
String deviceInfo = new String(serviceInfo.getTextBytes());

`
Why does the last call of serviceResolved method has the correct message?

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