Daemons?

Daniel Swe daviddavid at slaskpost.se
Wed Aug 15 04:54:51 PDT 2007


I want a single instance of the program. So that when I write ./test -console it doesnt really start a new instance of the program but instead connects to the older instance.

Deewiant Wrote:

> Daniel Swe wrote:
> > I'm trying to make a GUI that can display both opengl windows and/or terminal
> > windows (using ncurses). So one could start the program using a terminal
> > (using ./test -console for example) at work. But later when I get home I
> > would like a opengl window so I write ./test -opengl , and the same instance
> > of the program that was used for the console would pop up with all the bells
> > and whistles for opengl. The problem is that I don't really know how to do
> > it. Should I make a daemon that guis connect to? Is there any way to find the
> > pid and communicate with the instance using tango? Or is there another more
> > clever way? I'm currently using gdc and Tango in Ubuntu.
> > 
> 
> What's the problem? Just abstract out the user interface to a separate module
> (or package, if it grows large enough) and instantiate a different type of
> object depending on the command line. Or call a different set of functions, or
> have a global enum which chooses between UIs, but I think the OO approach is
> cleanest here.
> 
> -- 
> Remove ".doesnotlike.spam" from the mail address.



More information about the Digitalmars-d-learn mailing list