Offers the XMPP user with the specified JID the file with the specified
name and, if accepted by the user, transfers the file using the supplied
stream.
Namespace: S22.Xmpp.ClientAssembly: S22.Xmpp (in S22.Xmpp.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C# |
---|
public void InitiateFileTransfer( Jid to, Stream stream, string name, long size, string description = null, Action<bool, FileTransfer> cb = null ) |
Parameters
- to
- Type: S22.Xmpp..::..Jid
The JID of the XMPP user to offer the file to.
- stream
- Type: System.IO..::..Stream
The stream to read the file-data from.
- name
- Type: System..::..String
The name of the file, as offered to the XMPP user with the specified JID.
- size
- Type: System..::..Int64
The number of bytes to transfer.
- description (Optional)
- Type: System..::..String
A description of the file so the receiver can better understand what is being sent.
- cb (Optional)
- Type: System..::..Action<(Of <(<'Boolean, FileTransfer>)>)>
A callback method invoked once the other site has accepted or rejected the file-transfer request.
Exceptions
Exception | Condition |
---|---|
System..::..ArgumentNullException | The to parameter or the stream parameter or the name parameter is null. |
System..::..ArgumentOutOfRangeException | The value of the size parameter is negative. |
System..::..NotSupportedException | The XMPP entity with the specified JID does not support the 'SI File Transfer' XMPP extension. |
S22.Xmpp..::..XmppErrorException | The server or the XMPP entity with the specified JID returned an XMPP error code. Use the Error property of the XmppErrorException to obtain the specific error condition. |
S22.Xmpp..::..XmppException | The server returned invalid data or another unspecified XMPP error occurred. |
System..::..InvalidOperationException | The XmppClient instance is not connected to a remote host, or the XmppClient instance has not authenticated with the XMPP server. |
System..::..ObjectDisposedException | The XmppClient object has been disposed. |