Important: The information in this document is obsolete and should not be used for new development.
OTRegisterName
Registers a name on the network.C INTERFACE
OSStatus OTRegisterName (MapperRef ref, TRegisterRequest* req, TRegisterReply* reply);C++ INTERFACE
None. C++ applications use the C interface to this function.PARAMETERS
ref
- A mapper reference.
req
- A pointer to a
TRegisterRequest
structure that specifies the entity name you want to register and the protocol address it maps to.reply
- A pointer to a
TRegisterReply
structure that returns the actual protocol address registered and an ID that can be used to delete the name.- function result
- An error code. See Appendix B and the discussion below for more information.
DISCUSSION
If the mapper protocol defined using theconfig
parameter to theOTOpenMapper
orOTAsyncOpenMapper
functions supports dynamic name and address registration, you can use theOTRegisterName
function to make a name visible on the network to other network devices.
The format for the requested name and address is specific to the protocol used. Please consult the documentation for the protocol you are using for format information.
- Note
- Some protocol implementations under Open Transport allow a client to specify a name rather than an address when binding the endpoint using the
OTBind
function. Binding an endpoint by name causes the protocol to automatically register the name on the network if the protocol supports dynamic name registration. This is the simpler technique for registering a name and is preferred over creating a mapper provider and then using theOTRegisterName
function to register the name.If the mapper is in synchronous mode, the function does not return until the operation is complete. If the mapper is in asynchronous mode, the OTRegisterName function returns immediately. When the operation completes execution, the mapper provider issues the
T_REGNAMECOMPLETE
codeevent. The
cookie
parameter to the notification routine has the value of thereply
parameter passed to the OTRegisterName function. For more information on notifier functions and event codes see "Using Notifier Functions" and "Event Codes".If the name was already registered, the function returns the result
kOTAddressBusyErr
. If thereply->addr.maxlen
field is set to 0, then the address is not filled in and the resultkOTNoError
result is returned. If this field is not set to 0, the resultkOTBufferOverflowErr
is returned if the allocated buffer is not large enough to hold the address.SEE ALSO
TheOTLookupName
function.The
OTDeleteName
function.The
OTDeleteNameByID
function.The
OTOpenMapper
function.The
AsyncOpenMapper
function.