The Cascade NameServer

Cogent API and Utilities: Version 4.1
Prev |  | Next

# Chapter 4. The Cascade NameServer

The Cascade NameServer (nserve) provides network name services, information about queues and domains for all registered tasks, and alert messages to registered tasks whenever another task starts or stops on the network. The name server must be started after the Cascade QueueServer, qserve, usually through the `sysinit.N` startup file.

nserve is used to maintain information about currently running tasks in the Cascade DataHub universe. All names registered on the name server are considered global within the system network, and all names should be unique on the network. This facility cannot be used as a global semaphore due to the race conditions associated with more than one task attempting to use the same name. Tasks whose names do not particularly matter can be made up of a combination of node number and task id.

When a task starts up, it must register a name, queue, and domain with the name server in order to make itself available to other tasks in the system. A task is not strictly obligated to have a queue name, but it will not be able to receive asynchronous messages without one. This initialization is performed through the `IP_NserveInit` function. The domain of a task may be changed at any time using the `IP_TaskSetDomain` function.

| QNX Note: nserve provides facilities not available through the QNX nameloc program. It uses nameloc to identify itself to the QNX operating system and any Cascade DataHub processes, but the Cascade DataHub processes themselves do not need to register with nameloc. The nserve facility extends nameloc with: Asynchronous notification of tasks starting and stopping on a network-wide basis, without the need for a task to become "informed." Maintenance of a queue name for each task, so tasks can communicate asynchronously. Maintenance of a domain name for each task, so you can keep track of tasks' peers throughout the network.

# 4.1. Domains

All tasks using nserve must declare a domain. This is a character string of up to 15 characters that differentiates groups of cooperating processes. All processes with the same domain name are considered to be running in the same domain. This differentiation generally only affects the manner in which processes retrieve information from the Cascade DataHub.

Tasks do not need to specify a domain name for points in the datahub running in that domain. In order to access points in another domain, a process must prepend the domain name followed by a colon to the point name. Similarly, the Cascade DataHub will transmit a point name with the domain name attached when delivering an exception to a task in another domain. For example, if a task is running in the default domain and wishes to read a point, `water_level` in the `control` domain's datahub, it must access that point as `control:water_level`.

Prev | Home | Next
Working with TCP/IP | Up | Locating Other Tasks on the Network

Copyright 1995-2002 by Cogent Real-Time Systems, Inc.