On 12/19/2010 02:42 PM, "Cédric Krier" <[email protected]>" wrote:
> > So we need to get a way to find others running tryton client on the host (this > is not too complicated). I hope you don't intend to open a URI in another user's tryton client! > But we need to have a way to communicate with those running client and this > communication should work on every OS's (Unix (Linux, MacOSX) and Windows). > > We already thought about some solutions: > > - use a TCP socket on localhost for a range of port > - not really secure > - could have firewall issue > - limit the number of running client > > - use a file in .config directory for each processes > - need to lock writing/reading operation on the file > - could be slow to use filesystem I don't understand. Why worry about performance? Do you expect DoS attacks? > Any others ideas? How about a FIFO file in a .tryton/ or .config/ directory. The GUI can run a thread blocking in read(2) on the FIFO. Writing the URI to the FIFO would trigger a read(2) action in the client, and the subsequent validation and opening of the URI read. So when you run 'tryton <URI>' the client will check for existence of the fifo and a running client under the same euid. If both exist, write the URI to the fifo and exit. If they don't start the gui, open the URI and spawn a thread to listen on the fifo created. Afaik, if you use a fifo, you don't need to worry about locks. > > Thanks, > > [1] > http://groups.google.com/group/tryton-dev/browse_thread/thread/372c37aebf038f27/ > -- ________________________________________________________________ Paul Stevens paul at nfg.nl NET FACILITIES GROUP GPG/PGP: 1024D/11F8CD31 The Netherlands________________________________http://www.nfg.nl -- [email protected] mailing list
