Home Forums Support There are some errors ExamplesWPFFileTransfer demo

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #2623
    Anonymous
    Inactive

    Hello
    when I run the ExampelsWPFFileTransfer Demo, Encounter some errors when I transfer files。Specifically When the file is very small, such as 1k,2k. Can you give me some help , Thanks

    Regards,
    msdc123

    #2624
    Anonymous
    Inactive

    1. Is the error 100% reproducible?
    2. What is the exact size of the file you are using to create the problem?
    3. Can you provide any more information regarding the error?

    Regards,
    Marc

    #2625
    Anonymous
    Inactive

    Hello
    Thanks.
    1. not 100%. but when the file is 1k,almost 30%.
    2. I tested several times。 I meet the condition when the file size is 1K,20K
    3. such as the file size is 35112 . the received file size is 35000.

    4、in MainWindow.xaml,If i set sendChunkSizeBytes = 500000000 ;
    It almost ok.

    5、 I guess when i send data use
    connection.SendObject(“PartialFileData”, streamWrapper, customOptions, out packetSequenceNumber);

    if the streamwrapper’s data too small,will lead some mistake.

    6、in log file ,I didn’t find any related message.

    best regards

    #2626
    Anonymous
    Inactive

    Hello

    I think I have solved the problem.

    I change the code in MainWindow.xaml.cs

    public void AddData(long dataStart, int bufferStart, int bufferLength, byte[] buffer)
    {
    lock (SyncRoot)
    {
    data.Seek(dataStart, SeekOrigin.Begin);
    data.Write(buffer, (int)bufferStart, (int)bufferLength);

    ReceivedBytes += (int)(bufferLength – bufferStart);
    //add
    if (ReceivedBytes == SizeBytes)
    {
    data.Flush();
    }

    }

    NotifyPropertyChanged(“CompletedPercent”);
    NotifyPropertyChanged(“IsCompleted”);
    }

    Now It’s OK

    Best regards

    • This reply was modified 10 years, 6 months ago by .
    • This reply was modified 10 years, 6 months ago by .
    #2632
    Anonymous
    Inactive

    Yea, that seems like the sort of thing it might be. Many kind thanks for the fix. I have updated the repository and online example.

    Regards,
    Marc

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.