[prev in list] [next in list] [prev in thread] [next in thread] 

List:       rxtx
Subject:    Re: [Rxtx] =?koi8-r?b?RGlzY29ubmVjdGluZyAtIGNsb3NlKCkgcHJvYmxlbSBp?=
From:       Ivan Maidanski <ivmai () mail ! ru>
Date:       2009-11-28 16:57:33
Message-ID: E1NEQc1-0004Lu-00.ivmai-mail-ru () f59 ! mail ! ru
[Download RAW message or body]

"M.Dec-GMail" <mariusz.dec@gmail.com> wrote:
> ----- Original Message -----
> From: "Ivan Maidanski" <ivmai@mail.ru>
> Subject: Re: [Rxtx] Disconnecting - close() problem in RXTX solved
> 
> > I never claimed setDaemon patch would solve the port close problem. It
> > solves "not exiting" a badly-written application problem (I mean an app is
> > returning from main() without calling close() for ports).
> 
> It was general notice - not about close - but I am sorry - this is my
> mistake - you are right - Java daemon isn't the same as Linux/unix daemon's.
> So - your proposal is good, but I have observed that RXTXPort ends work even
> without close, if application ends with System.exit(0).

That's how exit works by the definition (contrary to returning from main(String[])).

> 
> But in this case  - If you will try my example without System.exit(0),
> program stays in memory and Netbeans says that application runs...
> This is the case of badly written application - what in this case?

No, in my case a "badly-written application" is exiting from an app w/o closing ports \
- this works with the original Sun Comm API but run into a "not exiting" problem with \
rxtx (unless System.exit is used, of course).

> Something is wrong in my technique of subsequent opens?
> Variables configuration?
> No finalize of the RXTX port? Maybe this is it.

Finalizers are not guaranteed to be ever run.

> If yes, everything should be changed and my example is workaround only - all
> threads disconnections should be done during close, inside RXTXPort.java..
> 
> Today I have written serial port scanner which is looking for specific
> external device checking all system serial ports - opening, sending query,
> closing (this is why I needed working close()).
> No memory waste, no lost threads in memory, but my application ends with
> System.exit(0).
> Workaround works...
> 
> Regards
> Mariusz Dec

At present, I use System.exit(0) in my app to workaround the absence of setDaemon \
too.

Regards,
Ovan
_______________________________________________
Rxtx mailing list
Rxtx@qbang.org
http://mailman.qbang.org/mailman/listinfo/rxtx


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic