On środa 12 marzec 2003 07:12 am, Lars Gullik Bjønnes wrote:
> Alfredo Braunstein <[EMAIL PROTECTED]> writes:
> | If it's a pid then it's _not_ globally unique. And how the client guesses
> | the pid? What pid is it?
>
> That would then be a problem for _all_ such programs.

I would implement it like this:

- a lyx with given version creates a pipe in location known to the family of 
tools in that version
- the client lyx (same version) looks for pipes owned by current user, in that 
known location(s) [search order may be elaborate if one wishes], with pipe 
names matching pattern that's unique for given version or a set of versions
- the client interrogates the server about a version, and goes to the next 
available pipe if versions mismatch

In most cases, that means that there will be only one pipe for each running 
server process version, per user. I don't see any problems so far. If anybody 
feels like having optional LYXPIPE envvar override the default location, 
that's fine.

Also, the convention in the unix world is to create pipes and non-daemon locks 
in /tmp. The last time KDE environment did create a pipe in my /home was in 
August 2001, and it was .kxmlrpcd pipe.

Right now, for DCOP, the KDE does create a file in home dir with *filename* of 
the pipe, and that filename is usually /tmp/.ICE-unix/dcop*

So, there's a file in home called .DCOPserver_blah, and this file contains a 
two lines: a line with pathname, and another one with PID of the dcopserver.

I guess that many of you guys invent artifical problems ;-))) First of all, 
the unix permission system works, so please let's forget about other users 
abusing your lyxserver. Second of all, any given lyx version should only 
communicate with a server of its own version (right?), so the fact that 
different versions could store pipes in different places doesn't hurt at all. 
Thirdly, IIRC the lyx client can interrogate lyx server for its version -- in 
case of mismatch, there either will be another pipe to check, or  the lyx 
server has to be started, right? I fail to see the problem -- either I'm 
blind, or there's none :)

Cheers, Kuba Ober

Reply via email to