title: Multicast on Android 2.2
body: <p>Has anyone gotten Multicast to work on Android 2.2, specifically JmDNS for Bonjour service detection.  There are many questions &amp; answers from the Android 1.5->2.0 timeframe, including on stackOverflow, that indicate varying levels of success, and a bug in the bug tracker that indicate it was fixed, and closed, for 2.2 (<a href="http://code.google.com/p/android/issues/detail?id=2323" rel="noreferrer">http://code.google.com/p/android/issues/detail?id=2323</a>) .  I've tried the "TuneControl" source code, but that worked on ~1.5 and has not been updated, and does not work for me on 2.2.</p>
  
  <p>So, the questions...
  1) Has <em>anyone</em> seen multicast work on 2.2, specifically JmDNS, and specifically for Bonjour service detection?</p>
  
  <p>2)  What is necessary in code to make this work?</p>
  
  <p>I'm using the appropriate permissions:</p>
  
  <p><code>&lt;uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" /&gt;</code></p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.INTERNET"/&gt;
  
  &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/&gt;
  
  &lt;uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/&gt;
  </code></pre>
  
  <p>I acquire the multicast lock:</p>
  
  <pre><code>WifiManager wifi = (WifiManager)getSystemService( Context.WIFI_SERVICE );
  if(wifi != null)
  {
      MulticastLock mcLock = wifi.createMulticastLock("mylock");
      mcLock.acquire();
  ...
  </code></pre>
  
  <p>And then try to start jmDNS to look for servers:</p>
  
  <pre><code>    mdns = JmDNS.create(addr, HOSTNAME);
      jmdns.addServiceListener(TOUCH_ABLE_TYPE, listener);
      jmdns.addServiceListener(DACP_TYPE, listener);
      ...
  </code></pre>
  
  <p>The listener never sees any services.  I've verified using Wireshark that the request packets are sent, and that the server responds, but the response packet are never seen by the socket listener code in the jmDNS library.</p>
  
  <p>So... am I missing something?  Is this still a bug?  Has ANYONE gotten anything even remotely like this to work???</p>