Path: utzoo!attcan!uunet!husc6!bloom-beacon!tut.cis.ohio-state.edu!cs.utexas.edu!milano!titan!janssen
From: janssen@titan.SW.MCC.COM (Bill Janssen)
Newsgroups: comp.windows.news
Subject: Re: multiple-server clients
Summary: how about a default connection?
Keywords: NeWS cps
Message-ID: <868@titan.SW.MCC.COM>
Date: 4 Jul 88 23:29:40 GMT
References: <853@macondo.SW.MCC.COM>
Organization: MCC Software Technology
Lines: 21

Xlib handles multiple servers with the notion of a `default server'.
All C calls on Xlib are directed toward that server.  The call to
connect to a server returns a handle to that server, and makes it the
default:

	display = XOpenDisplay (server_name);

The default display can be changed:

	XSetDisplay (display);

This works pretty well if the granularity of your interaction with the
server is modestly large, as it tends to be with X.  If you need an
interface that tends to send every command to every server, you may want
instead to implement a `grouped default server', which is really a list
of servers.  Every command would be repeated on each server in the list.
This could be implemented in the library so that all calls look alike,
and the functions are somewhat polymorphic, specializing on the server-type,
normal or grouped.

Warmest regards, Bill