OTOpenEndpoint
Opens an endpoint. This function is synchronous, and creates an endpoint that operates synchronously. It is strongly recommended that you use endpoints in asynchronous mode whenever possible.C INTERFACE
EndpointRef OTOpenEndpoint (OTConfiguration* config, OTOpenFlags oflag, TEndpointInfo* info, OSStatus* err);C++ INTERFACES
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 deletes the configuration structure when creating the endpoint or attempting to create it.oflag- Reserved; must be set to 0.
info- A pointer to an
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.
DESCRIPTION
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 isNULL.An endpoint created by the
OTOpenEndpointfunction operates in synchronous mode, unless you change the endpoint's mode of execution by calling theOTSetAsynchronousfunction. When an endpoint is in synchronous mode, all provider functions that use the endpoint execute synchronously.By default, a newly created endpoint does not block and does not acknowledge sends. To change the endpoint's default mode of operation, you can call the
OTSetBlockingfunction and theOTIsAckingSendsfunction.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.SPECIAL CONSIDERATIONS
TheOTOpenEndpointfunction changes the contents of memory and writes information to disk; your application should not call theOTOpenEndpointfunction at interrupt time.The
OTOpenEndpointfunction destroys the configuration structure returned by theOTCreateConfigurationfunction. If you want to use the same configuration to open additional endpoints, you must obtain a valid copy of the configuration structure before calling theOTOpenEndpointfunction, by calling theOTCloneConfigurationfunction.SEE ALSO
To create anOTConfigurationstructure, use theOTCreateConfigurationfunction described in the chapter "Configuration Management" in this book.To obtain a copy of the
OTConfigurationstructure, use theOTCloneConfigurationfunction described in the chapter "Configuration Management" in this book.To create an endpoint that operates asynchronously, call the
OTAsyncOpenEndpointfunction (page 3-71).Modes of execution are defined in the section "Modes of Operation," beginning on page 3-11. For information about changing an endpoint's mode of execution, see the chapter "Providers" in this book.
When you open an endpoint, Open Transport also creates the
TEndpointInfostructure, which contains important information about the endpoint (page 3-48).Endpoint states are defined and listed in"Endpoint States," beginning on page 3-13.
To close and delete an endpoint, call the
OTCloseProviderfunction described in the chapter "Providers" in this book.To bind a protocol address to an endpoint, call the
OTBindfunction (page 3-77).The
OTSetAsync,OTSetBlocking,andOTIsAckingSendsfunctions are described in the chapter "Providers" in this book.
Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help