Brecham.Obex — An OBEX library for the .NET Framework

ObexGetStream.ResponseHeaders Property

Gets any headers returned by the server.

[Visual Basic]
Public ReadOnly Property ResponseHeaders As ObexHeaderCollection
[C#]
public ObexHeaderCollection ResponseHeaders {get;}

Remarks

Common headers include Length, and Time. The Length header being most useful, as it is necessary to allow progress reporting. See for instance the FolderExplorer2 example which does byte-by-byte progress reporting if that header is returned by the server, or bouncing bar pseudo progress reporting if not.

This property gives access to the collection of the aggregate metadata headers received so far from the server, with any duplicate headers being discarded. Unfortunately the OBEX specification is not specific on where response metadata headers should come in the GET process. Generally — and hopefully always — the server will send all of the metadata headers before any content headers. Therefore the stream constructor has been changed to return only once the first body header has been received. This should guarantee that all the metadata headers have been received.

 

As noted above, the specfication does not describe where in a possible multi-packet exchange any headers should be returned; it only covers where the body headers are allowed: “The server device must not begin sending the object body chunks until the request phase is complete.” OBEX13.pdf Section 3.3.4.

The general order is however:

  1. Zero (but normally one) or more Request header(s) in one of more PDUs from the client.
  2. Zero or more Response metadata header(s) in zero or more PDUs.
  3. One of more content headers (Body/EndOfBody) in one or more PDUs.
Often the the last response metadata headers will come in the PDU with the first content header, and often there will be only one PDU containing metadata header. (If fact, for a small object, the response could be simply one PDU containing any metadata and a single content header). So, as noted above as long as the first content header has been received then the complete set of header should have arrived.

See Also

ObexGetStream Class | Brecham.Obex Namespace