PPP: removeEventListener doesnt seem to remove listener
"Prashant Viswanathan" <[email protected]> Mon, 24 May 2004 02:05:39 -0700
| Newsgroups | gmane.comp.hardware.microcontrollers.tini |
|---|---|
| Message-ID | <04f601c4416e$48f350d0$6401a8c0@VPRASHANT> |
I have an application which dials out from a TINI box and after conducting a socket transaction closes the PPPClient. It then attempts to dial out again after a couple of minutes. I can only do this twice after which I get an OutofMemory exception. Even if I retry after a "System.gc()", I have the same problem I am using a modified version of the PPPClient example which comes with TINI. I tried two approaches and have problems with both 1) Creating a new PPP object every time I dial out. This results in Out of memory exception as explained above. 2) Reusing the same PPP object. In this case I used removeEventListener while shutting down the PPPClient and addEventListener when I start it. But each time (after the first time) I call addEventListener TINI's ppp complains that there are too many listeners. It looks like removeEventListener doesn't remove the listeners properly. If I ignore this error and let it proceed PPP doesn't work correctly. It seems to get connected to the ISP but there is no "UP" event generated. <While dialing out second time> Exception adding event listener java.util.TooManyListenersException in java.lang.Throwable.??? in java.lang.Throwable.<init>(@JPC=4) in java.lang.Exception.<init>(@JPC=2) in java.util.TooManyListenersException.<init>(@JPC=2) in com.dalsemi.tininet.ppp.PPP.addEventListener(@JPC=30000d) in com.icontrol.ppp.PPPClient.run(@JPC=c0036) in java.lang.Thread.run(@JPC=22001a) Dialing Connected to ISP <cant communicate via PPP> PPP IS DOWN <Dialing out first time> Dialing Connected to ISP PPP IS UP <communication with PPP successful. ...socket transactions take place here> PPP IS DOWN I did search through the archives and found a post about a bug in removeEventListener but that post was from more than a year ago. I would appreciate any help/suggestions/pointers/example code. Thanks Prashant _______________________________________________ TINI mailing list TINI-6tN4nzCoH/[email protected] To UNSUBSCRIBE, edit your profile, or see list archives: http://lists.dalsemi.com/mailman/listinfo/tini