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
configparameter by calling theOTCreateConfigurationfunction. TheOTOpenEndpointfunction disposes of the configuration structure before returning.oflag- Reserved; must be set to 0.
info- A pointer to a
TEndpointInfostructure to be filled in by theOTOpenEndpointfunction. SpecifyNULLfor this parameter if you do not want theOTOpenEndpointfunction 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
NULLif the endpoint has not been created.DISCUSSION
TheOTOpenEndpointfunction opens an endpoint having the configuration specified by theconfigparameter. The function returns an endpoint reference, by which you refer to the created endpoint when calling provider functions. If theOTOpenEndpointfunction 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
OTSetAsynchronousfunction, theOTSetBlockingfunction and theOTAckSendsfunction.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 theOTBindfunction.To close and delete an endpoint, call the
OTCloseProviderfunction.SPECIAL CONSIDERATIONS
TheOTOpenEndpointfunction can only be called at system task time because it is a synchronous function.The
OTOpenEndpointfunction 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 theOTOpenEndpointfunction, by calling theOTCloneConfigurationfunction.SEE ALSO
"Creating a Configuration Structure"."Reusing Provider Configurations".
The
OTAsyncOpenEndpointfunction.