rsouissi
Hi,
I am reporting 3 issues here, 2 that existed on all J2ME versions and another one on the recent releases (at least starting from June/July).
The version I tried was for MIDP 2.0.
1)- If the client cannot connect (server down, TCP problem, etc), it goes into a very long or infinite loop trying to reconnect again and does not pause between retries, leading to 100% usage on the midlet (I noticed this using the emulator and the network monitor).
Also, if during this loop I make stopConnection (usingn a custom menu), it still continues to loop (after stopConnection, it goes into Off, but it seems the retry in the MIDP library process immediately puts it into "Connecting" status)
2)- If the lightstreamer server rejects the session (either because the metaadapter invalidated the user or because the server rejected the number of sessions), the client library does not notify this to the midlet using OnServerError and it keeps retrying. Looking in more details, it seems that the server in this case sends in the HTTP reply "ERROR\n\r<digit>\n\rSOME_CUSTOMER_ERROR" (digit could be 0, 7, etc) and the midp library breaks it down into "ERROR", <digit> and "SOME_CUSTOMER_ERROR" and does not notify these to the midlet (it seems it is missing a default "else" when the string does not start with "SYNC ERROR", a digit, "KeepaliveMillis", "SessionId", etc).
Note that the documentation for the network adapter says the server is supposed to send "ERROR <Digit> SOME_CUSTOMER_ERROR" (basically space instead of \n\r).
This issue prevents displaying any error coming from MetaAdapter or LS to the client (like wrong username/password, etc), which is quite annoying...
3) the performance issue was noticed on Windows mobile 5 and N95, E60 and N80.
With the old MIDP libraries and the demo library (which was used on the website applet a year ago), the library used to run in Streaming mode with quite a large load and no impact on midlet performance (menus were responsive, diaplay refresh fast, etc). But with the new libraries (starting in June or July), it started to cause a major slowdown (nothing is responsive), as if there was a background thread in the library hogging the CPU.
I don't know how to obtain a thread dump on a midlet, so it is quite difficult to know what happens.
Any ideas or hints for these 3 problems ?
Thanks
A
Mone
Hi,
about 1:
the connection loop is infinite, this is not an error. Note that the reconnection loop is not a strict loop as the error and the reconnection attempt live on different threads so it's strange that you get a 100% cpu load (I was unable to reproduce such behavior, do you have an example that I can try?). Anyway I've added a 100ms pause for the next release, hope that helps.
I've noticed that it's impossible to stop the loop, you're right, I fixed it.
Thank you very much for your feedback.