martafil / youtube-api-samples

Automatically exported from code.google.com/p/youtube-api-samples
0 stars 0 forks source link

The Request was aborted: The request was canceled (dotnet upload) #4

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create new console project
2. Paste in upload_video.cs and add references
3. Upload video that takes longer than about 100 seconds to upload

What is the expected output? What do you see instead?
Expect video to upload and status to update
Instead is says an error has occured - exception listed below

What version of the product are you using? On what operating system?
Sample code changed on Apr 19, 2013
Using google-youtube-v3-rev52-csharp-1.3.0-beta, and sample helper from 
google-api-dotnet-client-1.3.0-beta.samples
Windows 8 x64
Visual Studio 2012 Update 2

Please provide any additional information below.

 An error has occured:
    The request was aborted: The request was canceled.

 Press any key to display the stacktrace

 System.Net.WebException: The request was aborted: The request was canceled.
   at System.Net.ConnectStream.InternalWrite(Boolean async, Byte[] buffer, Int32
 offset, Int32 size, AsyncCallback callback, Object state)
   at System.Net.ConnectStream.Write(Byte[] buffer, Int32 offset, Int32 size)
   at Google.Apis.Upload.ResumableUpload`1.SendChunk(Stream stream, Uri uri, Int
64 position) in c:\code.google.com\google-api-dotnet-client\default_release\Tool
s\BuildRelease\bin\Debug\output\default\Src\GoogleApis\Apis\Upload\ResumableUplo
ad.cs:line 450
   at Google.Apis.Upload.ResumableUpload`1.Upload() in c:\code.google.com\google
-api-dotnet-client\default_release\Tools\BuildRelease\bin\Debug\output\default\S
rc\GoogleApis\Apis\Upload\ResumableUpload.cs:line 313
   at TestApp1.upload_video.<>c__DisplayClass3.<Main>b__2() in c:\Users\Adam\App
Data\Local\Temporary Projects\TestApp1\Program.cs:line 66
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionCo
ntext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, C
ontextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, C
ontextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

 Press any key to exit

Original issue reported on code.google.com by cyae...@gmail.com on 26 May 2013 at 10:16

GoogleCodeExporter commented 8 years ago
Added the following line to get it working, but it is uploading very slowly.  
About 7KB/s

videosInsertRequest.ChunkSize = 10000;

Original comment by cyae...@gmail.com on 26 May 2013 at 11:10

GoogleCodeExporter commented 8 years ago
Where did you add that line?

Original comment by sk...@halls.co.za on 30 Sep 2014 at 2:36