Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

Next Page > Hide TOC

Open Transport Reference

Framework
CoreServices/CoreServices.h
Declared in
OpenTransport.h
OpenTransportProtocol.h
OpenTransportProviders.h
queue.h
types.h

Overview

Open Transport is the Mac OS 8 and 9 API for accessing TCP/IP networks, such as the Internet, at the transport level. For Mac OS X, Apple provides Open Transport as a compatibility library to ease migration of legacy applications. As such, Mac OS X does not support the entire Open Transport API.

In new Mac OS X applications you should not use Open Transport but should instead use BSD Sockets or, when possible, higher-level Core Services and Core Foundation APIs such as CFNetwork, CFURL, CFSocket, and CFStream. You can also use Cocoa networking classes such as NSURL, NSURLHandle, and NSNetService.

In Mac OS X, Open Transport provides limited support for endpoints and port access, and no support for the XTI or UNIX STREAMS interfaces. If you want your application to run in Mac OS 8 and 9 and in Mac OS X, use Open Transport for your Mac OS 8 and 9 version and Apple’s newer APIs for your Mac OS X version.

For more information about Open Transport, see:

http://developer.apple.com/macos/opentransport/

Mac OS X supports only these Open Transport providers:

Mac OS X does not support ADSP, ATP, ASP, PAP, or serial endpoints.

You may have to revise your code if it uses Open Transport in one of the following ways:

Mac OS X does not support functions for:

Client context parameters have been added to a number of OT functions. (An OT client is an application or a shared library.) Each client of Open Transport now has its own client context so that OT can track resources it allocates on behalf of the client. OT resources are objects like endpoints, timer tasks, and blocks of memory. To find out more about Open Transport resources management, see “Understanding Open Transport Asset Tracking” at:

http://developer.apple.com/technotes/tn/tn1173.html

Mac OS X introduces a new type, OTClientContextPtr, that represents the OT client context. This new type is passed as an extra parameter to functions that allocate OT resources. Before Mac OS X, the OT client context was determined by the Open Transport static libraries that you linked to your application. Now the OT client context is determined explicitly. The same Carbon binary can run on Mac OS 8/9 and Mac OS X, and you do not have to link your application to the static libraries.

You can use InitOpenTransportinContext to replace InitOpenTransport. It functions identically except that it also takes a client context pointer and a flags parameter to indicate whether you are initializing OT for an application or a shared library. When your application or shared library is done using Open Transport you should call CloseOpenTransportInContext to dispose of the Open Transport resources allocated for the client.

The following functions now take a client context:

As a convenience, applications may pass a null pointer to these routines and Open Transport will use the context that was passed to InitOpenTransport. However, shared libraries must always pass a valid OTClientContextPtr.

If you want to keep your application source code compatible with pre-Mac OS X systems, you may define the C preprocessor constant OTCARBONAPPLICATION to 1 to use the old routine names without the “InContext” suffix.

Mac OS X applications must pass UPPs instead of procedure pointers for Open Transport callback routines. You can use these new functions to create UPPs:

OTNotifyUPP replaces OTNotifyProcPtr

OTProcessUPP replaces OTNotifyProcPtr

OTListSearchUPP replaces OTListSearchProcPtr

You can use these functions to allocate and free UPPs:

These functions have been modified to take an OTNotifyUPP UPP instead of a procedure pointer:

These functions have been modified to take an OTProcessUPP UPP instead of a procedure pointer:

These functions have been modified to take an OTListSearchUPP UPP instead of a procedure pointer:

Functions by Task

Initializing and Closing Open Transport

Creating, Cloning, and Disposing of a Configuration Structure

Opening and Closing Providers

Controlling a Provider’s Modes of Operation

Using Notifier Functions with Providers

Sending Module-Specific Commands to Providers

Creating Endpoints

Binding and Unbinding Endpoints

Obtaining Information About an Endpoint

Allocating Structures for Endpoints

Determining if Bytes Are Available for Endpoints

Functions for Connectionless Transactionless Endpoints

Establishing Connection for Endpoints

Functions for Connection-Oriented Transactionless Endpoints

Tearing Down an Endpoint Connection

Checking Synchronous Calls

Working With Timer Tasks

Working With Deferred Tasks

Creating Mappers

Registering and Deleting Names with Mappers

Looking Up Names for Mappers

Determining and Changing Option Values

Finding Options

Getting Information About Ports

Registering New Ports

Registering as a Client

Allocating and Freeing Memory

Memory Manipulation Utility Functions

Idling and Delaying Processing

String Manipulation Utility Functions

Timestamp Utility Functions

OTLIFO List Utility Functions

OTFIFO List Utility Functions

Adding and Removing List Elements

Atomic Operations

Handling No-Copy Receives

Resolving Internet Addresses

Opening a TCP/IP Service Provider

Getting Information About an Internet Host

Retrieving DNS Query Information

Internet Address Utilities

Single Link Multi-Homing

AppleTalk Utility Functions

Opening an AppleTalk Service Provider

Obtaining Information About Zones

Obtaining Information About Your AppleTalk Environment

Miscellaneous Functions

Callbacks by Task

Notifier Callbacks

System, Timer, and Deferred Task Callbacks

Linked List Callbacks

Miscellaneous Callbacks