
.. _structure-recv-transfer:

:index:`Receive Transfer Structure`
-----------------------------------

A Receive Transfer structure is returned from :meth:`~jetstream.recvinterface.RecvInterface.getTransfersAsync`. This structure describes a transfer that is being *received* on a server. This differs from the Transfer structure, which describes a transfer being *sent* from a server.

The Receive Transfer structure describes a receiving server's record of transfer while it is in progress. Note that the receiving server will (eventually) remove its record of a transfer when the transfer has finished (the files remain, of course), whereas the sending server will maintain its records of a transfer indefinitely.

.. glossary::
   :sorted:

   :index:`destinationPath <pair: Receive Transfer Structure; destinationPath>`
      The directory that will be created as the parent for all files in the transfer. The manifest paths are respected, and added below this destination path.

   :index:`lastErrorTime <pair: Receive Transfer Structure; lastErrorTime>`
      If there has been an interruption to a transfer at the receiving server at any time, this records the timestamp at which the interruption occurred. A value here does not necessarily mean that the transfer has failed; compare ``status``. See :doc:`/api/timestamps`.

   :index:`lastRecvTime <pair: Receive Transfer Structure; lastRecvTime>`
      A timestamp indicating the last receive activity. See :doc:`/api/timestamps`.

   :index:`lastSendTime <pair: Receive Transfer Structure; lastSendTime>`
      A timestamp indicating the last send activity. See :doc:`/api/timestamps`.

   :index:`sourceIP <pair: Receive Transfer Structure; sourceIP>`
      The IP for a source (i.e. the sending).

   :index:`sourcePort <pair: Receive Transfer Structure; sourcePort>`
      The port on which the source (i.e. sending) is connected. 

   :index:`status <pair: Receive Transfer Structure; status>`
      The status for this transfer. May be one of:

      - :index:`receiving <triple: Receive Transfer Structure; status; receiving>`
      - :index:`complete <triple: Receive Transfer Structure; status; complete>`
      - :index:`error <triple: Receive Transfer Structure; status; error>`

   :index:`totalSize <pair: Receive Transfer Structure; totalSize>`
      The total size, in bytes, of all files in this transfer.

   :index:`transferId <pair: Receive Transfer Structure; transferId>`
      The transfer ID for this transfer. Transfer IDs are returned from :meth:`~jetstream.sendinterface.SendInterface.createTransfer`, and used in other methods to refer to a specific transfer.

