Chapter Contents

Previous

Next
SAS/CONNECT User's Guide

Application Design

When designing a direct-messaging application, the client and server section must be choreographed so that they do not block one another. That is, you want to make sure the client and server applications are completely clear as to what to expect from each other.

A typical server application using direct-messaging would execute the following steps:

  1. Initialize the messaging environment.

  2. Listen for any messages.

  3. Respond to messages when required.

  4. Repeat steps 2 and 3 as needed.

  5. Shut down the messaging environment.

A typical client application using direct-messaging would execute the following steps:

  1. Initialize the messaging environment.

  2. Establish communication with a specific server.

  3. Send messages.

  4. Process any responses from the server.

  5. Repeat steps 3 and 4 as needed.

  6. Disconnect from the server.

  7. Shut down the messaging environment.

To accomplish the above steps, direct messaging provides two SCL classes (STATION and CNCTION) and a set of SCL methods for each class. When designing a direct messaging application, the application programmer must choreograph the client and server portions carefully. Using direct messaging, the SCL _query method will block until an incoming event is received. Also, the _send method will block if the receiving side is not listening for any messages.

You must specify a nickname (moniker) in any SAS server session (the session to which applications will connect). This value is then used by any client session in order to locate the server when connecting by using the CONNECT method.

The syntax for specifying the moniker is:

%let _moniker=protocol//network_node/service_name;

If you omit protocol, the moniker uses the default access method for that host. If you omit network_node, the moniker defaults to the local node. For example, by specifying the following in a SAS session that runs on a node named MYNODE

%let _moniker=/shr1;
you would default to the TCP/IP access method on the network node MYNODE, which uses the service name SHR1. The moniker can be initialized anywhere in the SAS application, prior to calling the direct-messaging methods.

Note:   TCP/IP is the only access method that supports distributed messaging.  [cautionend]


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.