Re: Limit Single Instance
- From: "Monique Y. Mudama" <spam@xxxxxxxxxxxxxxxx>
- Date: Tue, 31 Jan 2006 10:37:37 -0700
On 2006-01-31, Gordon Beaton penned:
>
> The other typical way is to open a ServerSocket listening on a
> specific port number. If that fails, you can assume your application
> is already running.
>
> This mechanism has two advantages:
>
> - the ServerSocket is automatically released regardless of how the
> application terminates, so no false positives are caused by failure
> to clean up (other applications or users using the same port number
> can still be a problem, so choose wisely).
>
> - a second program instance, upon failing to create the
> ServerSocket, can connect to the original and then exit, thereby
> signalling it to pop up or move to the front.
>
> /gordon
Ah, yes. Good points.
--
monique
Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html
.
- References:
- Limit Single Instance
- From: Allan Bruce
- Re: Limit Single Instance
- From: Monique Y. Mudama
- Re: Limit Single Instance
- From: Gordon Beaton
- Limit Single Instance
- Prev by Date: Stack And Heap
- Next by Date: Re: Beginner CSV error
- Previous by thread: Re: Limit Single Instance
- Next by thread: Re: Limit Single Instance
- Index(es):
Relevant Pages
|