Code example for WifiManager.MulticastLock

Methods: acquire, setReferenceCounted

0
					if (((DatagramData)impl).isMulticast()) {
						 
						WifiManager wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE);
						 
						multicastLock = wifi.createMulticastLock(getClass().getSimpleName());
						multicastLock.setReferenceCounted(false);
						multicastLock.acquire();
					} 
				} 
				 
				impl.start();
				 
			} catch (DataRemoteError e) {
				String msg = "failed to start " + getClass().getSimpleName();
				logger.error(msg, e);
				statusNotify(msg, "error", "service start failed", true);
				 
				return; 
			} 
 
			afterStart();