3.2.1.4 BITSSessionWrapper

BITSSessionWrapper encapsulates the state associated with the upload of a specific request entity.

A BITSSessionWrapper object contains the following properties:

  • BITSSessionId: This refers to BITS-Session-Id (section 2.2.3.2).

  • State: This represents the current active state of a BITSSessionWrapper object. This is an enumeration and contains one of the values mentioned in the following state table.

  • DestinationURL: This refers to the destination URL.

  • RequestEntityPath: This represents the physical path to the request entity for the upload. The rules specified for the Content-Name (section 2.2.1.1) header (maximum character limit, range of characters that can be used) apply to this as well.

  • ResponseEntityPath: This represents the physical path to the response entity used in upload-reply mode. The rules specified for Content-Name (section 2.2.1.1) header (maximum character limit, range of characters that can be used) apply to this as well.

  • UploadEntitySize: A 64-bit integer that represents the number of bytes of the request entity.

  • ReplyURL: This is the same as reply URL.

  • UploadComplete: A Boolean value that represents whether the server has all the bytes of the request entity.<20>

  • NotifyCache: A Boolean value that specifies whether the communication with the back-end client is complete.

  • ShouldcopyToDestination: A Boolean value that specifies whether the destination URL is populated.

  • HTTPStatusCode: This represents HTTP status code as described in [RFC2616] section 10.

  • BitsErrorCode: This represents BITS-Error (section 2.2.1.2).

  • BitsErrorContext: This represents BITS-Error-Context (section 2.2.1.2).

BITSSessionWrapper can be represented in the following states:

 State

 Description

STATE_INIT

This is the initial state for the machine.

STATE_RECEIVE_FRAGMENTS

BITSSessionWrapper waits for receiving fragments.

STATE_CANCEL

BITSSessionWrapper processes the CANCEL-SESSION request from the client. This is a terminal state.

STATE_NOTIFY

BITSSessionWrapper sends the request entity to the back-end client object, which in turn triggers notification to the server application.

STATE_WAIT_FOR_CLOSE

BITSSessionWrapper waits for a CLOSE-SESSION message from the client.

STATE_COMPLETE

BITSSessionWrapper processes CANCEL-SESSION, CLOSE-SESSION, and PING requests from the client. This is a terminal state.

Possible state transitions

Figure 5: Possible state transitions