Posted by
dscho on
Apr 28, 2011; 9:29am
URL: http://imagej.273.s1.nabble.com/Ubuntu-Run-single-instance-listener-tp3684690p3684691.html
Dear Ghislain,
On Thu, 28 Apr 2011, Ghislain Bugnicourt wrote:
> Sorry for asking again, but it seems that my previous message (13th of
> april) was ignored because somebody answered by asking another
> question...
Yep, sorry, I also planned to answer, but got side-tracked by the day-job
:-)
> I'm trying to correct a strange behavior of imagej on Ubuntu : when
> opening several images at the same time while ImageJ isn't started, the
> single instance listener (if checked in misc. options) doesn't work and
> one instance is started for each image. If ImageJ is already open, it
> works well (with imageJ 1.45e)
>
> I can't repeat this on MacOSX, that's why I try to correct the bug. :)
>
> I learned how to compile ImageJ, so I can test any idea of yours, if you
> tell me what to modify in the source code !
The first thing would be to find out in which sequence the code is called
that is supposed to check for an existing instance and the code that then
starts listening to the socket.
The code that checks whether there is already a running instance is here:
http://pacific.mpi-cbg.de/cgi-bin/gitweb.cgi?p=ImageJA.git;a=blob;f=ij/ImageJ.java;h=a446cac76eaf97f10c1adc01b1e32da3e4fb0c77;hb=imagej#l626The code to start the socket listener is here:
http://pacific.mpi-cbg.de/cgi-bin/gitweb.cgi?p=ImageJA.git;a=blob;f=ij/SocketListener.java;h=f6475b6f3602548dd382823c1ab7e86fc43ce563;hb=imagej#l29I typically insert some code like IJ.log("Checkpoint 1"); with a running
number so I can identify the places passed. You might also want to turn on
the debug mode by passing ImageJ the -debug option...
Please also note that IJ.log() outputs to the standard error (i.e. the
command-line window you started ImageJ in) as long as there is no instance
of ImageJ itself (i.e. the main window).
Sorry for the delay,
Johannes