我正在使用本地网络多人游戏进行android测验,其中主机应向所有客户端发送消息。我正在使用this的NsdChat示例。 但是,当我尝试重新服务时,会出现此错误。
E/NsdServiceInfo: While parsing txt records (pos = 1): Zero sized txt record
E/NsdHelper: Resolve Succeeded. name: NsdChatHost, type: ._http._tcp, host: /"myIP", port: "myPort", txtRecord:
E/NsdService: Unique id with no client mapping: 71
E/NsdService: Unhandled { when=-4ms what=393242 obj=com.android.server.NsdService$NativeEvent@157683e target=com.android.internal.util.StateMachine$SmHandler }
这是我的坚定听众。
public void initializeResolveListener() {
mResolveListener = new NsdManager.ResolveListener() {
@Override
public void onResolveFailed(NsdServiceInfo serviceInfo, int errorCode) {
Log.e(TAG, "Resolve failed" + errorCode);
}
@Override
public void onServiceResolved(NsdServiceInfo serviceInfo) {
Log.e(TAG, "Resolve Succeeded. " + serviceInfo);
if (serviceInfo.getServiceName().equals(mServiceName)) {
Log.d(TAG, "Same IP.");
return;
}
mService = serviceInfo;
}
};
}