Important: The information in this document is obsolete and should not be used for new development.
OTResolveAddress
Returns the protocol address that corresponds to a high-level address on an endpoint.C INTERFACE
OSStatus OTResolveAddress(EndpointRef ref, TBind* reqAddr, TBind* retAddr OTTimeout timeOut);C++ INTERFACE
OSStatus TEndpoint::ResolveAddress(TBind* reqAddr, TBind* retAddr);PARAMETERS
ref- The endpoint reference whose provider should do the address resolution.
req- A pointer to a
TBindstructure. The fieldreqAddr->addr.bufpoints to a buffer containing the high-level address. This address must be in an appropriate format for the protocol family. For example, for AppleTalk this must be anNBPAddress.ret- A pointer to a
TBindstructure. TheretAddr->addr.buffield points to a buffer that you filled out with the lowest-level address that corresponds to the address referenced by thereqAddr->addr.buffield of thereqAddrparameter.timeout- The maximum time in milliseconds that you want to wait for address resolution. Not all protocols honor this requirement.
- function result
- An error code. See Discussion.
DISCUSSION
TheOTResolveAddressfunction returns the lowest-level address for your endpoint. Not all endpoints support this function. If theCAN_RESOLVE_ADDRbitin theflagsfield of theTEndpointInfostructure is set, the endpoint supports this function. Using this function saves you the trouble of opening and closing a mapper if the only reason you have for opening the mapper is to look up the address corresponding to a specific endpoint name. This function is also useful in that you don't need to know the underlying protocol to resolve an address.You are responsible for allocating the buffers described by the
reqAddrandretAddrparameters required to hold the addresses. To determine how large these buffers should be, examine theaddrfield of theTEndpointInfostructure for the endpoint, which specifies the maximum amount of memory needed to store an address for the endpoint specified by therefparameter.If the endpoint is in synchronous mode, the funciton returns when the operation is complete. If the endpoint is in asynchronous mode and you have installed a notification routine, the
OTResolveAddressfunction returns immediately with thekOTNoErrorresult and sends theT_RESOLVEADDRCOMPLETEevent code to your notifier when the operation completes. See Appendix B. Theresultparameter iskOTNoErrorif the function succeeded or a negative result code if it did not. Thecookieparameter contains theretparameter. If a notifier is not installed, it is not possible to determine when theOTResolveAddressfunction completes. For more information on notifier functions and event codes seeMyNotifierCallbackfunction and "Event Codes".