[comp.windows.x] extension question

dana@atexnet.UUCP (Dana Burns) (02/21/90)

Is it "within X philosophy" to create an extension
that allocates memory on a "per-client" basis?

If so, is there a "standard" extensible way to
have the server call your extension if the client
connection goes down? (CloseDownClient).

Anyone out there make per-client-allocating
extensions that clean-up after themselves
without a server modification?

							-Dana

marvin@kelly.UUCP (Kyle Marvin) (02/22/90)

> Is it "within X philosophy" to create an extension
> that allocates memory on a "per-client" basis?

Can't vouch for the philosophical implications, but
we implement an extension which requires that data
structures be maintained on a "per-client" basis.
Seems like this is a *reasonable* thing to do.

> If so, is there a "standard" extensible way to
> have the server call your extension if the client
> connection goes down? (CloseDownClient).

Again, can't presume to offer the "standard" solution,
but here's something which works for us.  Upon first
contact with a client, create an extension specific
resource (see AddResource()) associated with the client.
For the data associated with the resource, store the
index of the client (pClient->index) or something else
which allows you to identify it.  Then associate your
own "delete" handler for the resource class and type
with the resource.  This "delete" handler will be
invoked whenever the client is shut down (and be
passed the client index you stored in AddResource().)
Do all your client-specific cleanup there.  The mechanisms
for doing this vary slightly between R3 and R4 due to
changes in the server resource handling.  If you need
more specifics, E-mail direct to me.

> Anyone out there make per-client-allocating
> extensions that clean-up after themselves
> without a server modification.

Yep, see above.  The solution above at least does not
require any changes to dix code.

>				-Dana

Kyle Marvin
Visual Information Technologies, Inc. (VITec)
UUCP: uunet!convex!vitsun!marvin
************************************************************
All men are moral.  Only their neighbors are not.  (Steinbeck)
************************************************************