Bug 3697 - FTP download with random results
Summary: FTP download with random results
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: C# Binding ()
Version: 2.8.5
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Mike Krüger
Depends on:
Reported: 2012-02-29 17:57 UTC by hellagolyonis
Modified: 2012-03-02 01:22 UTC (History)
1 user (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Comment 1 Mike Krüger 2012-03-01 04:47:37 UTC
What has this to do with monodevelop ?
Comment 2 hellagolyonis 2012-03-01 13:04:38 UTC
Well, the problem seems to be with the stream.Read method, so if you are not the ones who can fix this, who can? In which case, I would report this to somewhere else.
Comment 3 hellagolyonis 2012-03-01 13:08:48 UTC
I'm convinced this isn't due to my code and the fact it's multithread handled.

By the way, if you are the right ones, the ReadByte method seems to have some obvious mistake : it returns an integer!
Comment 4 hellagolyonis 2012-03-01 13:13:44 UTC
To explain myself : if the problem was due to my code, then the fact of downloading 16 bytes or 1024 wouldn't change anything, and there it does.

You could think it might be dued to my asynchronous file write method, but then, why the other one (which is commented), also fails the same way?

But who else would I contact for the "native" C# libraries from monodevelop than monodevelop?
Comment 5 Mikayla Hutchinson [MSFT] 2012-03-01 17:40:12 UTC
MonoDevelop on Windows by default targets the Microsoft .NET runtime. That means it compiles your app with the Microsoft .NET compilers, and runs it with the Microsoft .NET runtime.

If you've explicitly set up MonoDevelop to target the Mono runtime, then we should  reassign this bug to the Mono class libraries. If you're targeting .NET, you should report it to Microsoft - though you may have better answers from StackOverflow.com.
Comment 6 Mike Krüger 2012-03-02 01:22:55 UTC
In any case it's not realated to the "editor" where you type the code ...

btw. since it's opened on windows I assumed that he uses .NET compilers & .NET runtime.

other than that: I would say it's just a programming error ... stream.Read returns the number of bytes read you just ignore that value.

fileBytes = new byte[nbBitPerCut];
stream.Read(fileBytes, 0, nbBitPerCut);

May read let's say nbBitPerCut / 2 then you have a half filled byte array there - but you write the whole fileBytes array - and that'll produce the NULs. In any case I can't see why monodevelop is related to that ?