speech-dispatcher: Communication mechanisms

 
 3.1 Communication mechanisms
 ============================
 
 Speech Dispatcher supports two communication mechanisms: UNIX-style and
 Inet sockets, which are refered as 'unix-socket' and 'inet-socket'
 respectively.  The communication mechanism is decided on startup and
 cannot be changed at runtime.  Unix sockets are now the default and
 preferred variant for local communication, Inet sockets are necessary
 for communication over network.
 
    The mechanism for the decision of which method to use is as follows
 in this order of precedence: command-line option, configuration option,
 the default value 'unix-socket'.
 
    _Unix sockets_ are associated with a file in the filesystem.  By
 default, this file is placed in the user's runtime directory (as
 determined by the value of the XDG_RUNTIME_DIR environment variable and
 the system configuration for the given user).  It's default name is
 constructed as 'XDG_RUNTIME_DIR/speech-dispatcher/speechd.sock'.  The
 access permissions for this file are set to 600 so that it's restricted
 to read/write by the current user.
 
    As such, access is handled properly and there are no conflicts
 between the different instances of Speech Dispatcher run by the
 different users.
 
    Client applications and libraries are supposed to independently
 replicate the process of construction of the socket path and connect to
 it, thus establishing a common communication channel in the default
 setup.
 
    It should be however possible in the client libraries and is possible
 in the server, to define a custom file as a socket name if needed.
 Client libraries should respect the SPEECHD_ADDRESS environment
 variable.
 
    _Inet sockets_ are based on communication over a given port on the
 given host, two variables which must be previously agreed between the
 server and client before a connection can be established.  The only
 implicit security restriction is the server configuration option which
 can allow or disallow access from machines other than localhost.
 
    By convention, the clients should use host and port given by one of
 the following sources in the following order of precedence: its own
 configuration, value of the SPEECHD_ADDRESS environment variable and the
 default pair (localhost, 6560).
 
    ⇒Setting Communication Method.