Carbon


Data Transfer State Constants

Header: URLAccess.h

Identifies the current state of a data transfer operation.

enum URLState {
    kURLNullState = ,
    kURLInitiatingState = 1,
    kURLLookingUpHostState = 2,
    kURLConnectingState = 3,
    kURLResourceFoundState = 4,
    kURLDownloadingState = 5,
    kURLDataAvailableState = 21,
    kURLTransactionCompleteState = 6,
    kURLErrorOccurredState = 7,
    kURLAbortingState = 8,
    kURLCompletedState = 9,
    kURLUploadingState = 10
};

Constant descriptions

kURLNullState

Indicates that the function URLOpen has not yet been called.

kURLInitiatingState

Indicates that the function URLOpen has been called, but the location specified by the URL reference has not yet been accessed. The stream enters this state from the kURLNullState state.

kURLLookingUpHostState

Indicates that the function URLOpen has been called, and that the host is being looked up. The stream enters this state from the kURLInitiatingState state.

kURLConnectingState

Indicates that the function URLOpen has been called, and a connection is being made. The stream enters this state from the kURLLookingUpHostState state.

kURLResourceFoundState

Indicates that the location specified by the URL reference has been accessed and is valid. The stream enters this state from the kURLConnectingState state.

kURLDownloadingState

Indicates that the download operation is in progress but there is currently no data in the buffers. The stream enters this state initially from the kURLResourceFoundState state. During a download operation, the stream’s state may alternate between the kURLDownloadingState and the kURLDataAvailableState states.

kURLDataAvailableState

Indicates that the download operation is in progress and data is available in the buffers. The stream initially enters this state from the kURLDownloadingState state. During a download operation, the stream’s state may alternate between the kURLDownloadingState and the kURLDataAvailableState states. If the stream is in the data available state, you may want to call the function URLGetDataAvailable to determine the amount of data available for download. If you pass NULL in the fileSpec parameter of the function URLOpen, you will need to call the function URLGetBuffer to obtain the next buffer of data.

kURLTransactionCompleteState

Indicates that a download or upload operation is complete. The stream can enter this state from the kURLDownloadingState state.

kURLErrorOccurredState

Indicates that an error occurred during data transfer. The stream can enter this state from any state except the kURLAbortingState state. If the stream is in this state, you may wish to call the function URLGetError to determine the nature of the error.

kURLAbortingState

Indicates that a download or upload operation is aborting. The stream enters this state from the kURLErrorOccurredState state or as a result of calling the function URLOpen when the stream is in any other state. When your application calls the function URLAbort, the URL Access Manager changes the state returned by the function URLGetCurrentState to kURLAbortingState and passes the constant kURLAbortInitiatedEvent to your notification callback function.

kURLCompletedState

Indicates that there is no more activity to be performed on this stream. In this case, the data transfer has either completed successfully or been aborted. The stream enters this state from the kURLTransactionCompleteState or the kURLAbortingState state. When data transfer is terminated after a data transfer operation is aborted, the URL Access Manager changes the state returned by URLGetCurrentState to kURLCompletedState and passes the constant kURLCompletedEvent in the event parameter of your notification callback function.

kURLUploadingState

Indicates that an upload operation is in progress.

The URLState enumeration defines constants that identify the status of a data transfer operation with respect to a URL. The function URLGetCurrentState passes back one of these constants in the state parameter to indicate the status of a data transfer operation. All constants except kURLDataAvailableState and kURLCompletedState can be returned at any time. If you pass a valid file specification in the fileSpec parameter of the function URLOpen, your notification callback function will not be notified of data available and transaction completed states as identified by the constants kURLDataAvailableState and kURLTransactionCompleteState.


© 2000 Apple Computer, Inc. (Last Updated 7/17/2000)