We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpElectronics,  Serial Library › intermittent problems with serial and exported app
Page Index Toggle Pages: 1
intermittent problems with serial and exported app (Read 2297 times)
intermittent problems with serial and exported app
May 12th, 2010, 11:36pm
 
I have a sketch running on a osx 10.6 machine - now it is exported to an app it successfully lauches sometimes, but other times fails with the old gnu port in use exception. It gets as far as putting the name of the app in the menu bar and no further - the window never appears. Quitting and launching it again sometimes solves it - sometimes need to do it a few times.

Is there anything I can do to make it more reliable for starting as this is a touring show that I wont be at and they are nervous.
Re: intermittent problems with serial and exported app
Reply #1 - May 13th, 2010, 11:25pm
 
Most often, I see this when the port is not released by the previous application (or run of same app).

Does your sketch use the stop() method to do last-minute clean up?
Keep in mind that the JVM is not required to call stop(). [per JVM spec]
Re: intermittent problems with serial and exported app
Reply #2 - May 14th, 2010, 6:50am
 
That makes sense.

I haven't put stop() in.

If the JVM is not required to call stop, does that mean it might ignore it if you have written code in a stop() function?

I see super.stop() being added in some sketches - does this provide additional security?
Re: intermittent problems with serial and exported app
Reply #3 - May 15th, 2010, 3:57am
 
Since your sketch extends a PApplet, calling super.stop() insures that the normal last-minute stuff gets done. Assuming stop gets called...

Unfortunately, yes, the code may be ignored.
I suspect that if you use the official JVM and not inside a web browser, you would have better odds.

Hope it helps.
Page Index Toggle Pages: 1