Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ AConnectRec(3X) — HP-UX ANSI C A.10.11

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

APlaySStream(3X)

ARecordSStream(3X)

AConnectRecordSStream(3X)

NAME

AConnectRecordSStream − connect socket to TCP socket address; return transaction ID

SYNOPSIS

#include <Alib.h> ATransID
AConnectRecordSStream (

Audio ∗  audio,

SStream ∗  remote_sstream,

SSRecordParams ∗  rp,

long ∗  status_return );

DESCRIPTION

AConnectRecordSStream() is used by an application that is preparing to send a record sound stream to an audio server on another system.  After creating a socket, the application calls AConnectRecordSStream() to connect it to the other server at the TCP socket address contained in remote_stream. Get the pointer to remote_stream from the application that controls the other audio server. 

audio specifies the Audio structure associated with this application’s connection to its own server. 

remote_sstream is a structure containing a TCP socket addresss (passed in from the application program), audio attribute, and the maximum block size, in bytes, of each transfer of audio data over the connection. 

rp is the structure containing the record gain, pause_first toggle, gain matrix, and the mask for event notification. 

status_return receives the returned status of the operation, unless this parameter is passed in as a NULL pointer.  If status_return is set to NULL, Alib will do the error handling. 

RETURN VALUE

Upon successful completion, AConnectRecordSStream() returns a transaction ID. 

STRUCTURES

The following is defined in /opt/audio/include/Alib.h:

typedef long      ATransID; /* Type for transaction ID. */

ERRORS

If status_return is not set to NULL, it can return one of the following values:

0   AENoError No error - the call completed successfully. 

2   AEBadAudio The audio structure is invalid.  A pointer to a valid audio structure may be missing (use AOpenAudio() to get a valid pointer). 

10  AEBadGainMatrix The gain matrix specified as part of the record parameters is invalid. 

EXAMPLE

The following example connects a socket to another server’s TCP socket address and returns a transaction ID for the operation. 

ATransID        xid;         /* transaction ID */
Audio           *audio;      /* audio connection */
SStream         *r_sstream;  /* remote stream descrip */
SSRecordParams  *ss_rp;      /* sstream record params */
long             status;     /* error status */
 .
 .
 .
/* connect to TCP socket addr and get transID */
xid = AConnectRecordSStream(audio, r_sstream, ss_rp, &status);

NOTES

One difference between this routine and ARecordSStream() is that ARecordSStream() returns a TCP socket address while AConnectRecordSStream() takes a TCP socket address as a parameter.  The following text compares the two routines. 

AConnectRecordSStream():

− Takes a TCP socket address supplied by the application program

− The application program must perform a "listen" and "accept"

− The Audio server performs the "connect"

ARecordSStream():

− Returns the TCP socket address supplied by the Audio server

− The Audio server performs the "listen" and "accept"

− The application program must perform the "connect"

In order to ensure that the compiler finds the Audio Library (libAlib.sl) and the Alib.h header file, you must add the following switches:

-L /opt/audio/lib
-I/opt/audio/include

DEPENDENCIES

This function belongs to the Audio Library of functions that manage connections to an audio server.  The audio server must run on a system that has audio hardware. To find out whether or not your system has audio hardware, refer to Using the Audio Developer’s Kit or the online help for the Audio control panel.  For information about the audio capabilities of a particular system use the online example audioinfo.c. 

AUTHOR

AConnectRecordSStream() was developed by HP. 

SEE ALSO

APlaySStream(3X), ARecordSStream(3X). 

Hewlett-Packard Company  —  Audio Library: February, 1995

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026