(Page 7 of 16 in this chapter)


ppxCreateConnection

Description

Creates a connection.

Prototype

DWORD ppxCreateConnection ( CTAHD ctahd,
char *name,
PPX_HANDLE_PARMS *parms,
PPXHD *ppxhd )

ctahd CTA context handle returned by ctaCreateContext.

name Pointer to a connection name, or NULL value.

parms Pointer to a PPX_HANDLE_PARMS structure. The structure is defined as follows:


typedef struct
{
 DWORD size;   
 BYTE default_pattern;
 DWORD reserved;     
} PPX_HANDLE_PARMS

ppxhd Pointer to connection handle.

Return Values

Events

Details

This function creates a connection and returns a handle to it. Initially, the connection has no talker or listeners attached to it.

A default pattern is specified when the connection is created so that any listeners added to the connection will receive this pattern if there is no talker attached. If a default pattern is not specified in the call to ppxCreateConnection, the default pattern is set to 0x7f (mu-law), unless otherwise specified by the IdleCode switching fabric attribute within the PPX configuration file.

A name can also be specified when creating the connection. A name is required to access the connection across applications using ppxOpenConnection. Named connections will persist at client exit.

See Also

ppxCloseConnection, ppxOpenConnection

Example

void WhileTheyWait( MYCONTEXT *cx ) 
{
    DWORD e;
    char  ppxname [20];

    DemoStartProtocol( cx->hd, cx->protocol, NULL, NULL );  
    
    /* Allocate a connection */
    sprintf( ppxname, "ppxdemo%01d", cx->id );
    e = ppxCreateConnection( cx->hd, ppxname, &ppx_parms, 
                                   &(ppxhd[cx->id]) );
    if (e != SUCCESS)
    {
        printf("Unable to create a connection ; returns: %d\n",e);
        exit(-1);
    }


(Page 7 of 16 in this chapter)


tech_support@nmss.com
Copyright © 1999, Natural MicroSystems, Inc. All rights reserved.