Service discovery leads to system failure. The type of discovery I'm trying to do is
"_ http._tcp".
Here is the magazine.
D / NsdService (13310): Discover services
E / AndroidRuntime (13310): *** FATAL EXCEPTION IN SYSTEM PROCESS: NsdService
E / AndroidRuntime (13310): java.lang.NullPointerException
E / AndroidRuntime (13310): at com.android.server.NsdService $ ClientInfo.access $ 1200 (NsdService.java:801)
E / AndroidRuntime (13310): at com.android.server.NsdService $ NsdStateMachine $ EnabledState.requestLimitReached (NsdService.java:244)
E / AndroidRuntime (13310): at com.android.server.NsdService $ NsdStateMachine $ EnabledState.processMessage (NsdService.java:292)
E / AndroidRuntime (13310): at com.android.internal.util.StateMachine $ SmHandler.processMsg (StateMachine.java:905)
E / AndroidRuntime (13310): at com.android.internal.util.StateMachine $ SmHandler.handleMessage (StateMachine.java:760)
E / AndroidRuntime (13310): at android.os.Handler.dispatchMessage (Handler.java:99)
E / AndroidRuntime (13310): at android.os.Looper.loop (Looper.java:137)
E / AndroidRuntime (13310): at android.os.HandlerThread.run (HandlerThread.java:60)
The code I'm using to start the discovery,
NsdManager nsd = (NsdManager) getSystemService (Context.NSD_SERVICE);
nsd.discoverServices ("_ http._tcp.", NsdManager.PROTOCOL_DNS_SD, discoveryListener);
When I start, my phone restarts every time. I assume this is a bug on Android 4.2.2.
android android-nsd
Kumar bibek
source share