Important: The information in this document is obsolete and should not be used for new development.
OTUnbind
Dissociates an endpoint from its address or cancels an asynchronous call to theOTBind
function.C INTERFACE
OSStatus OTUnbind(EndpointRef ref);C++ INTERFACE
OSStatus TEndpoint::Unbind();PARAMETERS
ref
- The endpoint reference of the endpoint that you are unbinding.
- function result
- An error code. See Discussion.
DISCUSSION
If the endpoint is in synchronous mode, the function returns when the unbind is completed.If the endpoint is in asynchronous mode and you have installed a notifier, the function returns
kOTNoError
and the provider sends the event codeT_UNBINDCOMPLETE
to your notifier when the unbind is completed. For more information on notifier functions and event codes, seeMyNotifierCallback
function and "Event Codes". If you have not installed a notifier function, the only way to determine that the endpoint has been unbound is to use theOTGetEndpointState
function to poll the state of the endpoint. The function returns thekOTStateChangeErr
result until the unbind completes. If the function succeeds, the state of the endpoint isT_UNBND
. If it fails, its state isT_IDLE
.For connectionless endpoints, a common error code is
kOTLookErr
, usually indicating that more data has arrived. Since XTI defines that theOTUnbind
function can succeed only when there is no data available, the only recourse is to either read the data and call theOTUnbind
function again or to close the endpoint.After you unbind an endpoint, you can no longer use it to send or receive information. You can use the
OTCloseProvider
function to deallocate memory reserved for the endpoint, or you can use theOTBind
function to associate it with another address and then resume transferring data or establishing a connection.SPECIAL CONSIDERATIONS
In asynchronous mode, the endpoint provider might call your notifier function before the function's initial return.SEE ALSO
TheOTBind
function.The
OTCloseProvider
function.