Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Networking With Open Transport / Part 2 - Open Transport Reference
Chapter 22 - Endpoints Reference / Functions
Creating Endpoints /


OTOpenEndpoint

Opens an endpoint. This function is synchronous, and creates an endpoint that operates synchronously.

C INTERFACE
EndpointRef OTOpenEndpoint ( OTConfiguration* config, 
                     OTOpenFlags oflag, 
                     TEndpointInfo* info, 
                     OSStatus* err);
C++ INTERFACE
None. C++ applications use the C interface to this function.

PARAMETERS
config
A pointer to an endpoint configuration structure that specifies the endpoint's characteristics. You obtain a value for the config parameter by calling the OTCreateConfiguration function. The OTOpenEndpoint function disposes of the configuration structure before returning.
oflag
Reserved; must be set to 0.
info
A pointer to a TEndpointInfo structure to be filled in by the OTOpenEndpoint function. Specify NULL for this parameter if you do not want the OTOpenEndpoint function to provide endpoint information.
err
A pointer to the result code for this function.
function result
An endpoint reference for the endpoint that has been created or NULL if the endpoint has not been created.
DISCUSSION
The OTOpenEndpoint function opens an endpoint having the configuration specified by the config parameter. The function returns an endpoint reference, by which you refer to the created endpoint when calling provider functions. If the OTOpenEndpoint function fails, its return value is kOTInvalidEndpointRef.

The function creates an endpoint that is synchronous, does not block, and does not acknowledge sends. To change these settings, you can call the OTSetAsynchronous function, the OTSetBlocking function and the OTAckSends function.

The initial state of an endpoint is T_UNBND, meaning that the endpoint is not bound to an address. Before using the endpoint to transfer data, you must bind it to an address by calling the OTBind function.

To close and delete an endpoint, call the OTCloseProvider function.

SPECIAL CONSIDERATIONS
The OTOpenEndpoint function can only be called at system task time because it is a synchronous function.

The OTOpenEndpoint function disposes of the configuration structure passed in as a parameter. If you want to use the same configuration to open additional endpoints, you must obtain a copy of the configuration structure before calling the OTOpenEndpoint function, by calling the OTCloneConfiguration function.

SEE ALSO
"Creating a Configuration Structure".

"Reusing Provider Configurations".

The OTAsyncOpenEndpoint function.

"Endpoint States".


Previous Book Contents Book Index Next

© Apple Computer, Inc.
15 JAN 1998