Open GoogleCodeExporter opened 9 years ago
I just realized that my second suggestion allows to create multiple instances
like this:
1. Start Eclipse IDE
2. Start OLV (will use a different port)
3. Close Eclipse IDE
4. Start another instance of OLV (will use the default port)
To prevent this, one could do something like saving the port used by the first
instance somewhere and then use that port from then on.
Original comment by jochen.u...@gameforge.com
on 26 Nov 2014 at 2:48
Hi
Thanks for reporting this issue. It should be first fixed in:
https://github.com/otros-systems/Single-Instance
Method getRandomSocket()
https://github.com/otros-systems/Single-Instance/blob/master/src/main/java/com/n
egusoft/singleinstance/SocketUtil.java#L98 should accept starting port. This
parameter should propagated to methods getPortToUse and SingleInstance.request
If this will be done, OtrosLogViewer can use port from configuration.
Original comment by krzyszto...@gmail.com
on 26 Nov 2014 at 9:04
[deleted comment]
Ah! You already implemented random port selection! Then all my guessing was
wrong! :-)
Now I realized how the issue arised for me: I started OLV the first time
without Eclipse running. Therefore, OLV selected the port 1000 and wrote it to
the file "%TEMP%/OtrosLogViewer-%USERNAME%". However, OLV didn't delete the
file when closing it. Therefore, it tried to use that port again, the next time
I wanted to start it but this time, Eclipse was running and used the port.
I could easily fix the issue for me by changing the port in the file
"%TEMP%/OtrosLogViewer-%USERNAME%" from 10000 to 10001.
So the real issue is that the file "%TEMP%/OtrosLogViewer-%USERNAME%" does not
get deleted when OLV is closed.
Maybe you should call fileUtil.getFile().deleteOnExit() in
SocketUtil.markSocketAsBusy() rather than
SocketUtil.closeSocketAndRemoveMarkerFile() which seems not to be called for
some reason.
Original comment by jochen.u...@gameforge.com
on 27 Nov 2014 at 9:52
I have added fixes to Single-Instance.jar (ver 1.3). Now it is possible to set
starting port using: -DsingleInstance.startPort=32131
I have also change default port to 10001. Can you test it, latest build can be
downloaded from:
https://www.dropbox.com/s/cl6whh9qv89ea7a/olv-1.3.0-SNAPSHOT.zip?dl=0
Please also verify if file "%TEMP%/OtrosLogViewer-%USERNAME% when OLV is closed.
Original comment by krzyszto...@gmail.com
on 27 Nov 2014 at 11:27
Everything is working fine in that snapshot!
- Start port can be defined via olv.bat
- Default port is 10001
- %TEMP%/OtrosLogViewer-%USERNAME% is deleted when OLC is closed!
Nice! Thanks for the quick fix! :-) Keep up the good work!
Original comment by jochen.u...@gameforge.com
on 28 Nov 2014 at 9:44
Original issue reported on code.google.com by
jochen.u...@gameforge.com
on 26 Nov 2014 at 2:31Attachments: