[Pipet Devel] Re: Booting and shutting down piper

Brad Chapman chapmanb at arches.uga.edu
Fri Dec 15 16:11:16 EST 2000

[moving this to the list, since I'm confused by the threading of the
message -- then I also don't have to worry about forwarding to
everyone; apologies to list people, since this will seem disjoint]

Hey guys;
    Holy crap -- I got back home to get the unexpected surprise of
having 100 messages about Booting and Shutting down Piper. I think I
sort of followed what is going on, but not really -- too many messages 

Anyways, here is how things work right now with the UI and DL with a

The UI is easy to shut down -- it is shut down by the user. Right?
This is what the 'quit' menu item is for :-). Anyways, this then shuts
itself down, so that is taken care of.

The DL keeps track of UIs (remember, it can have multiple user
interfaces) using a ping function defined in the UIL2DL idl file:

    interface UilClient {
      readonly attribute string username;
      readonly attribute string password;
      void ping();

The client (UI) implements the ping function (which only needs to return 
when called), and the server (the DL) calls it every 20 seconds or
so. If the ping fails to return (with a CORBA_COMM error) then the DL
removes the connection with this UI and cleans up after it. When the
DL has no UIs left (when they either shut down normally or fail this
ping() test) then the DL then shuts itself down.

I know that the ping function is not that fancy (the C++ book by
Henning and Vinoski has a much nicer "evictor" pattern that it
describes) but it is simple and seems to work okay so far. I borrowed
this idea from the Berlin project, which uses something similar (at
least they did when I was browsing their code).

Anyways, in my opinion this works well, and should be extended to the
BL and PL. I think it is better then storing PIDs and then calling
kill for a couple of reasons:

1. Just as easy to implement (very important :-).
2. Works when the different layers are not on the same machine.
3. Handles more complicated client/server interactions then just

Of course, you guys are coding it, so feel free to do whatever you
want. This is just my opinion (which you did ask for :-).

Let me know if this doesn't make any sense, or if you need me to 
answer other questions -- I got a little lost in the flood of 
e-mails and am waaaay behind on my e-mail in general. Also, if
you need to talk to me right away ever I'm always trying to watch ICQ
if I at my computer working, so feel free to drop me a line and bug me 
to answer a question right away :-).


More information about the Pipet-Devel mailing list