(Page 8 of 17 in this chapter) Version
ppxCreateConnection
Description
- Creates a connection.
Prototype
- DWORD ppxCreateConnection ( CTAHD ctahd,
char *name,
PPX_HANDLE_PARMS *parms,
PPXHD *ppxhd )
- ctahd 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 *reservation_key;
} PPX_HANDLE_PARMS
- Set reservation_key field to NULL. This field is not used.
- 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. Any listeners added to the connection will receive the default 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.
- The reservation_key field is currently not used, therefore should be set to NULL.
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 8 of 17 in this chapter) Version
Want to send us feedback on our documentation? Email: Tech_Pubs@nmss.com
Copyright © 2001, NMS Communications Corporation. All rights
reserved.