public static void DownloadFile(string fileTransferKey, ulong size, string host, ushort filePort, Stream downloadStream, Action <string> connectedMethod, Action <string, Exception, SocketError?> errorMethod, Action <string, ulong, ulong> progressMethod, Action <string> finishedMethod, Func <string, bool> abortFunction)
        {
            Validate(fileTransferKey, host, filePort, downloadStream);
            AsyncFileTranserHelper fileTransferHelper = new AsyncFileTranserHelper(host, filePort, fileTransferKey, size, downloadStream);

            fileTransferHelper.DownloadFile(connectedMethod, errorMethod, progressMethod, finishedMethod, abortFunction);
        }
        public static void UploadData(string fileTransferKey, string host, ushort filePort, ulong numberOfBytesToSkip, ulong numberOfBytesToSend, Stream sourceStream, Action <string> connectedMethod, Action <string, Exception, SocketError?> errorMethod, Action <string, ulong, ulong> progressMethod, Action <string> finishedMethod, Func <string, bool> abortFunction)
        {
            Validate(fileTransferKey, host, filePort, sourceStream);

            if (numberOfBytesToSkip > 0)
            {
                sourceStream.Seek((long)numberOfBytesToSkip, SeekOrigin.Current);
            }

            AsyncFileTranserHelper fileTransferHelper = new AsyncFileTranserHelper(host, filePort, fileTransferKey, numberOfBytesToSend, sourceStream);

            fileTransferHelper.UploadFile(connectedMethod, errorMethod, progressMethod, finishedMethod, abortFunction);
        }
 public static void DownloadFile(string fileTransferKey, ulong size, string host, ushort filePort, Stream downloadStream, Action<string> connectedMethod, Action<string, Exception, SocketError?> errorMethod, Action<string, ulong, ulong> progressMethod, Action<string> finishedMethod, Func<string, bool> abortFunction)
 {
     Validate(fileTransferKey, host, filePort, downloadStream);
     AsyncFileTranserHelper fileTransferHelper = new AsyncFileTranserHelper(host, filePort, fileTransferKey, size, downloadStream);
     fileTransferHelper.DownloadFile(connectedMethod, errorMethod, progressMethod, finishedMethod, abortFunction);
 }
        public static void UploadData(string fileTransferKey, string host, ushort filePort, ulong numberOfBytesToSkip, ulong numberOfBytesToSend, Stream sourceStream, Action<string> connectedMethod, Action<string, Exception, SocketError?> errorMethod, Action<string, ulong, ulong> progressMethod, Action<string> finishedMethod, Func<string, bool> abortFunction)
        {
            Validate(fileTransferKey, host, filePort, sourceStream);

            if (numberOfBytesToSkip > 0)
                sourceStream.Seek((long) numberOfBytesToSkip, SeekOrigin.Current);

            AsyncFileTranserHelper fileTransferHelper = new AsyncFileTranserHelper(host, filePort, fileTransferKey, numberOfBytesToSend, sourceStream);
            fileTransferHelper.UploadFile(connectedMethod, errorMethod, progressMethod, finishedMethod, abortFunction);
        }