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

ObexClientSession.Put Method (ObexHeaderCollection)

Initiates a Put operation with the given collection metadata, returning a Stream that the consumer writes the content to.

[Visual Basic]
Overloads Public Function Put( _
   ByVal headers As ObexHeaderCollection _
) As ObexPutStream
[C#]
public ObexPutStream Put(
   ObexHeaderCollection headers
);

Parameters

headers
[Advanced usage] A ObexHeaderCollection containing any metadata to be sent before the content, such as Name, Time etc. Any Connection Id will be added automatically.

Return Value

An instance of ObexPutStream connected to the peer server.

Exceptions

Exception Type Condition
InvalidOperationException Another operation is in progress.
ObexResponseException The response code returned by the peer is not the one expected at that point in the transfer. This will likely indicate why the peer is unable to accept the tranfer. For instance Window’s Wireless Link application returns 0xC3 Forbidden if the user does not confirm the PUT, and if the transfer fill the disk, fails with 0xCD EntityTooLarge. PalmOS does not prompt the user at the beginning of the transfer, but if the object is too big it fails with 0xC1 Unauthorized. Finally on one model of Nokia phone I've tested against, if the object is too big the phone simply closes the connection.
InvalidOperationException Abort has been called previously and has not completed.
IOException Any IOException that can occur on writing to or reading from a Stream.

See Also

ObexClientSession Class | Brecham.Obex Namespace | ObexClientSession.Put Overload List