Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Networking With Open Transport / Part 2 - Open Transport Reference
Chapter 22 - Endpoints Reference / Functions
Binding and Unbinding Endpoints /


OTUnbind

Dissociates an endpoint from its address or cancels an asynchronous call to the OTBind 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 code T_UNBINDCOMPLETE to your notifier when the unbind is completed. For more information on notifier functions and event codes, see MyNotifierCallback 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 the OTGetEndpointState function to poll the state of the endpoint. The function returns the kOTStateChangeErr result until the unbind completes. If the function succeeds, the state of the endpoint is T_UNBND. If it fails, its state is T_IDLE.

For connectionless endpoints, a common error code is kOTLookErr, usually indicating that more data has arrived. Since XTI defines that the OTUnbind function can succeed only when there is no data available, the only recourse is to either read the data and call the OTUnbind 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 the OTBind 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
The OTBind function.

The OTCloseProvider function.

Table 4-4 .


Previous Book Contents Book Index Next

© Apple Computer, Inc.
15 JAN 1998