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
TBind
structure. The fieldreqAddr->addr.buf
points 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
TBind
structure. TheretAddr->addr.buf
field points to a buffer that you filled out with the lowest-level address that corresponds to the address referenced by thereqAddr->addr.buf
field of thereqAddr
parameter.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
TheOTResolveAddress
function returns the lowest-level address for your endpoint. Not all endpoints support this function. If theCAN_RESOLVE_ADDR
bitin the
flags
field of theTEndpointInfo
structure 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
reqAddr
andretAddr
parameters required to hold the addresses. To determine how large these buffers should be, examine theaddr
field of theTEndpointInfo
structure for the endpoint, which specifies the maximum amount of memory needed to store an address for the endpoint specified by theref
parameter.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
OTResolveAddress
function returns immediately with thekOTNoError
result and sends theT_RESOLVEADDRCOMPLETE
event code to your notifier when the operation completes. See Appendix B. Theresult
parameter iskOTNoError
if the function succeeded or a negative result code if it did not. Thecookie
parameter contains theret
parameter. If a notifier is not installed, it is not possible to determine when theOTResolveAddress
function completes. For more information on notifier functions and event codes seeMyNotifierCallback
function and "Event Codes".