#110 Set uniqueness eliminating discovered service infos

open
nobody
networking (37)
5
2013-01-24
2011-11-13
No

ServiceInfo has an equals() method that only compares qualified names. This causes an issue in the jmmdns list method where a set is used. Since multiple jmdns instances can list service infos on different interfaces (e.g. eth0, tap0) as well as ipv4, ipv6, alot of the legitimate service infos get lost due to uniqueness property.

I worked around this by simply using lists instead of sets and adding a more in depth comparison check in the jmmdns.list() method, but the service info itself might want to implement it in the equals if it doesn't disturb anything else.

Also rather depends on getting service info's to work correctly across multiple interfaces/ipv4&6 (see other bug report).

From impl/jmmdns.java

@Override
public ServiceInfo[] list(final String type, final long timeout) {
// We need to run this in parallel to respect the timeout.
final Set<ServiceInfo> result = Collections.synchronizedSet(new HashSet<ServiceInfo>(_knownMDNS.size() * 5));
ExecutorService executor = Executors.newCachedThreadPool();
for (final JmDNS mDNS : _knownMDNS.values()) {
executor.submit(new Runnable() {
/**
* {@inheritDoc}
*/
@Override
public void run() {
result.addAll(Arrays.asList(mDNS.list(type, timeout)));
}
});
}

Discussion

  • Nobody/Anonymous

    6xcikf <a href="http://vopjqftjxajs.com/">vopjqftjxajs</a>, [url=http://quckvbzhneoe.com/]quckvbzhneoe[/url], [link=http://yhfibkjhdhbj.com/]yhfibkjhdhbj[/link], http://defvhxrnpdry.com/

     
  • Nobody/Anonymous

    6xcikf <a href="http://vopjqftjxajs.com/">vopjqftjxajs</a>, [url=http://quckvbzhneoe.com/]quckvbzhneoe[/url], [link=http://yhfibkjhdhbj.com/]yhfibkjhdhbj[/link], http://defvhxrnpdry.com/

     
  • Nobody/Anonymous

    I'm curious to find out what blog system you have been working with? I'm having some minor security issues with my latest website and I'd like to find something more risk-free. Do you have any suggestions?
    north face jackets for women http://northfacecoat.yep.com/

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks