6100 ADCCP Programming Manual

Application Tasks
Writing Applications that Use ADCCP
4–22 069225 Tandem Computers Incorporated
An application should keep ahead of the link by posting multiple RECEIVETEXT
requests to await incoming frames. There must be at least one RECEIVETEXT request
for polling to occur.
Note ADCCP can have a total of only eight pending RECEIVETEXT requests. Only one process should make
RECEIVETEXT requests; otherwise ADCCP could deliver data, and possibly control frames, to the wrong
process.
Shutting Down the Link An application can shut down the link for a single station or a whole line.
No application should shut down a station or disconnect a line as long as other
applications might still want to use it.
To shut down the link for a single station, the application makes a WRITEREAD call
with the MODE SET request and puts the station in DISC mode. If the local station is a
primary station, ADCCP sends a DISC command to the remote station to disconnect it.
If the local station is a secondary station, ADCCP sends DM responses to frames that
arrive for the station. The shutdown of a secondary station can be reversed with a
mode-setting sequence. For a local station that is a primary station, the MODE SET
request to reverse the shutdown comes from an application. For a local station that is
a secondary station, a command must arrive on the line in order to reverse the
shutdown.
If you do not want a station to respond to incoming mode-setting frames, use a MODE
SET request to put the station in DEAD mode instead of in DISC mode. If you want to
shut down the link for more than one station, include a list of stations in the MODE
SET request.
If your application disconnects the stations on a line, you may also want it to
disconnect the line by dropping the DTR signal. For example, if the line is switched, it
may not be cost-effective to maintain the connection. To drop DTR, an application
makes a WRITEREAD call with the (68) MODEM CONTROL request. To connect a
line again after disconnecting it, an application must first make another (68) MODEM
CONTROL request followed by a (67) MODE SET request for the stations whose link
the application wants to restore.
An application may want to shut down the link unconditionally, without waiting for
data transfers in progress to finish. A WRITEREAD call with the (7)STOP
OPERATION request clears all of the ADCCP queues and disconnects the modem.
To start the line again, an application must begin with the (6)START OPERATION
request.
Closing the Line An application that finishes its use of the line should issue a CLOSE call to correspond
to every one of its OPEN calls. In fact, if an application no longer needs all of its
OPEN call, it should close as many as possible, to make way for other openers. There
is a limit of 15 concurrent opens of a line.