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

ObexClientSession.PutFrom Method (Stream, ObexHeaderCollection)

Put the contents of the given Stream to the peer, with the given collection of metadata.

[Visual Basic]
Overloads Public Sub PutFrom( _
   ByVal source As Stream, _
   ByVal headers As ObexHeaderCollection _
)
[C#]
public void PutFrom(
   Stream source,
   ObexHeaderCollection headers
);

Parameters

source
The Stream whose contents to send.
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.

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.PutFrom Overload List