OTAsyncOpenMapper
Creates a mapper and installs a notifier function for the mapper provider. TheOTAsyncOpenMapperfunction is asynchronous and creates a mapper that operates asynchronously by default.C INTERFACE
OSErr OTAsyncOpenMapper (OTConfiguration* config, OTOpenFlags oflag, OTNotifyProcPtr proc, void* contextPtr);C++ INTERFACES
None. C++ applications use the C interface to this function.PARAMETERS
config- A pointer to an endpoint configuration structure that specifies the mapper's characteristics. You obtain a value for the
configparameter by calling the OTCreateConfiguration function. TheOTAsyncOpenMapperfunction deletes the configuration structure after creating the mapper or attempting to create it.oflag- Reserved; must be set to 0.
proc- A pointer to a notifier function for this mapper. If you do not provide a notifier function, your application cannot receive Open Transport events, including the event advising you that the mapper has been created.
contextPtr- A context pointer for your use. The mapper provider passes this pointer value when calling the notifier function you specify in the
procparameter. You might use thecontextPtrparameter, for example, to pass to your notifier function information about your application's current context.DESCRIPTION
TheOTAsyncOpenMapperfunction opens a mapper having the configuration specified by theconfigparameter. For additional information see the chapter "Configuration Management" and the documentation provided for the name-binding protocol you are using. TheOTAsyncOpenMapperfunction runs asynchronously, returning a result code as soon as the function has been queued for execution.The
OTAsyncOpenMapperfunction attempts to create a mapper, and then calls the notifier function that you specified in theprocparameter, passingT_OPENCOMPLETEfor thecodeparameter, a result code in theresultparameter, and the mapper reference for the newly created mapper in thecookieparameter.A mapper created by the
OTAsyncOpenMapperfunction operates in asynchronous mode, unless you change the mapper's mode of execution by calling theOTSetSynchronousfunction. When a mapper is in asynchronous mode, all provider functions that use the mapper execute asynchronously.By default, a newly created mapper does not block and does not acknowledge sends. To change the mapper's default mode of operation, you can call the
OTSetBlockingfunction and theOTIsAckingSendsfunction.You can open multiple mappers using identical or different configurations, although if you use identical configurations, you must read the "Special Considerations" section. The different mappers can be distinguished by the mapper reference. You can set the
contextPtrparameter to point to the mapper reference or to a structure containing the mapper reference; this allows your notifier function to determine to which mapper a completion event belongs.SPECIAL CONSIDERATIONS
TheOTAsyncOpenMapperfunction destroys the configuration value returned by theOTCreateConfigurationfunction. You cannot use the same configuration to open multiple mappers. To obtain a valid copy of the configuration for use when opening another mapper, you must call theOTCloneConfigurationfunction.COMPLETION EVENT CODES
T_OPENCOMPLETE0x20000007 The OTAsyncOpenMapperfunction has completed. Thecookieparameter of the notifier function points to the mapper reference for the new mapper.SEE ALSO
To open a mapper in synchronous mode, use theOTOpenMapperfunction (page 4-19).To close and delete a mapper use the
OTCloseProviderfunction, described in the chapter "Providers" in this book.For more information about a mapper's mode of operations, see the section "Setting Modes of Operation for Mappers" on page 4-5.
The
OTCreateConfigurationfunction used to create the configuration structure that defines the protocols underlying the mapper is discussed in the chapter "Configuration Management" in this book.The
OTSetAsynchronousfunction, theOTSetBlockingfunction, theOTIsAckingSendsfunction, and the notifier function are described in the chapter "Providers" in this book.
Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help