[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

11/06/2009 at 07:51AM PST, ID: 24878209
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

6.9

Reading a file from the server through a WebService is slow

Asked by jdressing in .NET Framework 3.x versions, Microsoft Visual Basic.Net, Visual Studio

Tags: WebService Copy File

I have had to stream a file in chunks to support a progress bar and support transferring very large files... but it is so much slower than a standard HTTP download.  Is there anything I can do to speed this up?
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
Public Function DownloadChunk(ByVal FileName As String, ByVal Offset As Long _
 , ByVal BufferSize As Integer) As Byte()
            Dim TmpBuffer As Byte()
            Dim BytesRead As Integer 
            Try
                Using fs As New FileStream(FilePath, FileMode.Open, FileAccess.Read, FileShare.Read)
                    fs.Seek(Offset, SeekOrigin.Begin)
                    ' this is relevent during a retry. otherwise, it just seeks to the start 
                    TmpBuffer = New Byte(BufferSize - 1) {}
                    ' read the first chunk in the buffer (which is re-used for every chunk) 
                    BytesRead = fs.Read(TmpBuffer, 0, BufferSize)
                End Using
                If BytesRead <> BufferSize Then
                    ' the last chunk will almost certainly not fill the buffer, so it must be trimmed before returning 
                    Dim TrimmedBuffer As Byte() = New Byte(BytesRead - 1) {}
                    Array.Copy(TmpBuffer, TrimmedBuffer, BytesRead)
                    Return TrimmedBuffer
                Else
                    Return TmpBuffer
                End If
            Catch exRead As Exception
                CustomSoapException("Error reading file", exRead.Message)
                Return Nothing
            End Try
End Function
[+][-]11/06/09 07:55 AM, ID: 25760196

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/06/09 07:56 AM, ID: 25760210

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/06/09 08:15 AM, ID: 25760425

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/06/09 08:30 AM, ID: 25760564

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/06/09 08:35 AM, ID: 25760608

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/06/09 08:46 AM, ID: 25760738

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/06/09 08:50 AM, ID: 25760776

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/06/09 08:58 AM, ID: 25760863

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/06/09 09:01 AM, ID: 25760894

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/06/09 09:32 AM, ID: 25761140

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/06/09 10:56 AM, ID: 25761937

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/06/09 12:09 PM, ID: 25762611

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/06/09 12:18 PM, ID: 25762682

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/06/09 12:24 PM, ID: 25762723

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/06/09 12:59 PM, ID: 25763000

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: .NET Framework 3.x versions, Microsoft Visual Basic.Net, Visual Studio
Tags: WebService Copy File
Sign Up Now!
Solution Provided By: CodeCruiser
Participating Experts: 1
Solution Grade: B
 
 
 
Loading Advertisement...
20090824-EE-VQP-74 - Hierarchy / EE_QW_3_20080625