Important: The information in this document is obsolete and should not be used for new development.
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 theOTCreateConfiguration
function. TheOTOpenEndpoint
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 theOTOpenEndpoint
function. SpecifyNULL
for this parameter if you do not want theOTOpenEndpoint
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
TheOTOpenEndpoint
function opens an endpoint having the configuration specified by theconfig
parameter. The function returns an endpoint reference, by which you refer to the created endpoint when calling provider functions. If theOTOpenEndpoint
function fails, its return value iskOTInvalidEndpointRef
.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, theOTSetBlocking
function and theOTAckSends
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 theOTBind
function.To close and delete an endpoint, call the
OTCloseProvider
function.SPECIAL CONSIDERATIONS
TheOTOpenEndpoint
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 theOTOpenEndpoint
function, by calling theOTCloneConfiguration
function.SEE ALSO
"Creating a Configuration Structure"."Reusing Provider Configurations".
The
OTAsyncOpenEndpoint
function.