Developer --> Technical Publications

     


Responding to Data Transfer Events

Data transfer events are generated during a call to URLOpen after:

  • URLOpen has been called but the location specified by the URL reference has not yet been accessed
  • the location specified by the URL reference has been accessed and is valid
  • a download operation is in progress
  • a data transfer operation has been aborted
  • all operations associated with a call to URLOpen have been completed
  • an error occurred during data transfer
  • data is available in buffers
  • a download operation is complete because there is no more data to retrieve from buffers
  • an upload operation is in progress
  • a system event has occurred
  • the size of the data being downloaded is known
  • a time interval of approximately one quarter of a second has passed
  • a property such as a filename has become known or changed
  • If you want to be notified of data transfer events, pass a Universal Procedure Pointer (UPP) to your notification callback function in the notifyProc parameter of URLOpen . To create a UPP to your notification callback, you must call the function NewURLNotifyUPP . You must also specify which data transfer events you want to receive as a bitmask in the eventRegister parameter of URLOpen . You can then manipulate the data or write it to the destination of your choice.

    Your application's notification callback function should process the event record passed by the URL Access Manager in the event parameter and return 0. The only restriction that the URL Access Manager imposes on the functionality of your notification callback function is that it should not call the function URLDisposeReference . For information on how to write a notification callback, see URLNotifyProcPtr .


    © 2000 Apple Computer, Inc. (Last Updated 20 July 2000)