-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Solved exceeded the number of permissible registered listeners #23
Conversation
…G network on samsung device)
Hi @xcadrik, can you please provide more information how you reproduce that crash on your side? An code example where you call NetMonster Core with threading would be helpful. I managed to get Samsung A40 with Android 11 but can't reproduce it even when I call |
Hi,
You can look at this code, it is open source, but switch netmonster-core to your master branch:
https://github.com/rtr-nettest/open-rmbt-android/tree/feature/all_cell_info_dialog
I think you just need to allow permissions and turn on location, manually restrict network to use only 2G, basically app crashes after few seconds when it is restricted to use 2G networks on exceeded number of listeners.
If not, then maybe when you go to settings and turn on expert mode -> go back to home screen-> tap on the frequency/signal -> dialog should appear with cells details could help.
Thank you for any advice.
Bc. Michal Cádrik
Softvérové oddelenie
<http://www.martes-specure.com/>
MARTES, s.r.o.
Dlhá 88, 010 09
Žilina, Slovakia
IČO 31625410, OROS Žilina, vl.č. 2518/L
T: <tel:+421415628931> +421 41 562 89 39
M: <tel:+421948875933> +421 948 033 555
***@***.***> ***@***.***
<http://www.martes-specure.com/> www.martes-specure.com
From: Michal Mroček ***@***.***>
Sent: Monday, August 2, 2021 21:36
To: mroczis/netmonster-core ***@***.***>
Cc: Michal Cádrik ***@***.***>; Mention ***@***.***>
Subject: Re: [mroczis/netmonster-core] Solved exceeded the number of permissible registered listeners (#23)
Hi @xcadrik <https://github.com/xcadrik> , can you please provide more information how you reproduce that crash on your side? An code example where you call NetMonster Core with threading would be helpful.
I managed to get Samsung A40 with Android 11 but can't reproduce it even when I call getCells() every 500 ms.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#23 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AII2LMN3LFODAXKPYQRFSBDT23XQJANCNFSM5BD6E3KQ> .
Triage notifications on the go with GitHub Mobile for iOS <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android <https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email> .
|
Hey, thanks for the sample. As far as I can see you are querying the lib from multiple places and threads. Especially The only proper way how to fix it is to synchronise access from all threads to that critical section where it eventually crashes. It works but processing time increases. And in a few seconds response time is around 6 000 ms. I'll keep looking for solutions but some code optimisation from your side would be also good! |
Thank you a lot!
Yes, I was looking at that problem of accessing it at multiple places. I plan to do some optimization, but I had no time/not planned yet – (more critical stuff in other project), but sure I will take a look as soon as I can.
BTW it is a good library. I wanted to achieve something similar by myself, but I have no access to so many devices (a lot of differences in api implementation/behavior for different models) and I have no such networking knowledge (I do not understand to all those numbers we can get from cell info)
Big thank you for that.
Bc. Michal Cádrik
Softvérové oddelenie
<http://www.martes-specure.com/>
MARTES, s.r.o.
Dlhá 88, 010 09
Žilina, Slovakia
IČO 31625410, OROS Žilina, vl.č. 2518/L
T: <tel:+421415628931> +421 41 562 89 39
M: <tel:+421948875933> +421 948 033 555
***@***.***> ***@***.***
<http://www.martes-specure.com/> www.martes-specure.com
From: Michal Mroček ***@***.***>
Sent: Tuesday, August 3, 2021 09:47
To: mroczis/netmonster-core ***@***.***>
Cc: Michal Cádrik ***@***.***>; Mention ***@***.***>
Subject: Re: [mroczis/netmonster-core] Solved exceeded the number of permissible registered listeners (#23)
Hey, thanks for the sample. As far as I can see you are querying the lib from multiple places and threads. Especially getCells() is invoked at the nearly same time (a few ms diff) from different threads (saveCellInfo, updateInfo). But the main issue is how you use getNetworkType() which is invoked every 100 ms. This eventually floods internal queue of the lib and getCells() response time will be 3 000 ms+ instead of usual 300 ms (on that Samsung A40).
The only proper way how to fix it is to synchronise access from all threads to that critical section where it eventually crashes. It works but processing time increases. And in a few seconds response time is around 6 000 ms.
I'll keep looking for solutions but some code optimisation from your side would be also good!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#23 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AII2LMN4HEIZNLUHFKECRQTT26NIVANCNFSM5BD6E3KQ> .
Triage notifications on the go with GitHub Mobile for iOS <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android <https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email> .
|
Should be fixed by caching (2ed098a); tested on your app and avg. response time on Samsung A40 was ~300ms whilst on 2G/EDGE, tested for 10 minutes. Your app seemed to work a bit better 👍. |
Sorry for the late reply my accounts have been hacked,I went on github to
see if I could get help,I don't no shit about computers
…On Wed, Jul 28, 2021, 5:17 AM xcadrik ***@***.***> wrote:
I was able to reproduce the issue with Samsung Galaxy A51 (Android 11)
with forced to use 2G network only in our project. We use getCells() from
various threads with 1s refresh rate and it seems that it has problem to
unregister listener properly in some cases. When I added that line, then
app continue and problem does not occur anymore for now. But I am not 100%
sure if it is correct solution.
------------------------------
You can view, comment on, or merge this pull request online at:
#23
Commit Summary
- Solved problem with too many listeners (occurred when forced to use
2G network on samsung device)
File Changes
- *M*
library/src/main/java/cz/mroczis/netmonster/core/feature/config/TelephonyManagerListeners.kt
<https://github.com/mroczis/netmonster-core/pull/23/files#diff-d4d7538bc4940beb84b7c563480c6dacb4d3e2e0b450f401a2d6545b4b3df3ac>
(1)
Patch Links:
- https://github.com/mroczis/netmonster-core/pull/23.patch
- https://github.com/mroczis/netmonster-core/pull/23.diff
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#23>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AO4FLWXZTIKJKGEFHDD2CSDTZ7DLZANCNFSM5BD6E3KQ>
.
|
I was able to reproduce the issue with Samsung Galaxy A51 (Android 11) with forced to use 2G network only in our project. We use getCells() from various threads with 1s refresh rate and it seems that it has problem to unregister listener properly in some cases. When I added that line, then app continue and problem does not occur anymore for now. But I am not 100% sure if it is correct solution.