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 theOTBindfunction.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
kOTNoErrorand the provider sends the event codeT_UNBINDCOMPLETEto your notifier when the unbind is completed. For more information on notifier functions and event codes, seeMyNotifierCallbackfunction 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 theOTGetEndpointStatefunction to poll the state of the endpoint. The function returns thekOTStateChangeErrresult 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 theOTUnbindfunction can succeed only when there is no data available, the only recourse is to either read the data and call theOTUnbindfunction 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
OTCloseProviderfunction to deallocate memory reserved for the endpoint, or you can use theOTBindfunction 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
TheOTBindfunction.The
OTCloseProviderfunction.