Transfer Event

Fired during file download/upload.

Syntax

public event OnTransferHandler OnTransfer;

public delegate void OnTransferHandler(object sender, SshplexTransferEventArgs e);

public class SshplexTransferEventArgs : EventArgs {
  public string OperationId { get; }
  public int Direction { get; }
  public string LocalFile { get; }
  public string RemoteFile { get; }
  public string RemotePath { get; }
  public long BytesTransferred { get; }
  public int PercentDone { get; }
  public string Text { get; }
public byte[] TextB { get; } public bool Cancel { get; set; } }
Public Event OnTransfer As OnTransferHandler

Public Delegate Sub OnTransferHandler(sender As Object, e As SshplexTransferEventArgs)

Public Class SshplexTransferEventArgs Inherits EventArgs
  Public ReadOnly Property OperationId As String
  Public ReadOnly Property Direction As Integer
  Public ReadOnly Property LocalFile As String
  Public ReadOnly Property RemoteFile As String
  Public ReadOnly Property RemotePath As String
  Public ReadOnly Property BytesTransferred As Long
  Public ReadOnly Property PercentDone As Integer
  Public ReadOnly Property Text As String
Public ReadOnly Property TextB As Byte() Public Property Cancel As Boolean End Class

Remarks

This event is fired once per file when it starts downloading/uploading.

OperationId is associated with the operation that fired this event. Direction is 0 for Uploads and 1 for Downloads. LocalFile, RemoteFile, and RemotePath are populated with values of LocalFile, RemoteFile, and RemotePath, respectively, that are associated with the operation that fired this event.

BytesTransferred shows the number of bytes transferred since the beginning of the transfer, and PercentDone contains the percentage (0-100) of bytes transferred based on the Direction being transferred. If PercentDone cannot be calculated the value will be -1.

Text contains the text of the file being transferred.

Setting Cancel to true will cancel the associated operation without firing a DownloadComplete or UploadComplete event. It is not equivalent to calling CancelOperation with the associated OperationId, which will fire the aforementioned events.

Copyright (c) 2023 /n software inc. - All rights reserved.
IPWorks SSH 2020 .NET Edition - Version 20.0 [Build 8501]