android.net.wifi.WifiManager.MulticastLock Java Examples

The following examples show how to use android.net.wifi.WifiManager.MulticastLock. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: WifiUtils.java    From tilt-game-android with MIT License 5 votes vote down vote up
public static MulticastLock aquireMulticastLock(final Context pContext, final String pMulticastLockName) {
	final WifiManager wifiManager = WifiUtils.getWifiManager(pContext);
	final MulticastLock multicastLock = wifiManager.createMulticastLock(pMulticastLockName);
	multicastLock.setReferenceCounted(true);
	multicastLock.acquire();
	return multicastLock;
}
 
Example #2
Source File: WifiUtils.java    From tilt-game-android with MIT License 4 votes vote down vote up
public static MulticastLock aquireMulticastLock(final Context pContext) {
	return WifiUtils.aquireMulticastLock(pContext, WifiUtils.MULTICASTLOCK_NAME_DEFAULT);
}
 
Example #3
Source File: WifiUtils.java    From tilt-game-android with MIT License 4 votes vote down vote up
public static void releaseMulticastLock(final MulticastLock pMulticastLock) {
	if (pMulticastLock.isHeld()) {
		pMulticastLock.release();
	}
}