[fpc-pascal] simpleipc
Luca Olivetti
luca at ventoso.org
Thu Oct 16 17:27:57 CEST 2008
En/na Brad Campbell ha escrit:
> What I ended up doing was creating a lockfile and having the server hold
> an exclusive lock on it.
> If the server starts and can get an exclusive lock then it know's it is
> the first process running, and to delete the ipc pipe if it hangs over
> from a crash.
Well, if you detected that's the first (and only) instance running, then
you don't need the ipc server anymore, do you? (as long as it was used
only to detect multiple invocations).
There's a component/unit named uniqueinstance/uniqueinstanceraw to do
that, but since I had problems with it (the process starting more than
once), I modified as you say to use a lockfile.
Somehow someone managed to start two copies of the same server, I still
don't know how since I cannot reproduce it.
Bye
--
Luca
More information about the fpc-pascal
mailing list