473,811 Members | 2,970 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Connection error to WebService when chunkSize is to small

djp
Hi
I have a weird situation which i don't understand.
I have simple WebService that sends file to Client.

When i set chunk size to 16 kB file is received without any exceptions...
However when i set it to 1kB i get random exceptions ( cannot connect to
webservice ).
As a result i cannot download whole file. What i can download is about half
of the file ( 18MB ) with moreless 10 exceptions.
When i catch exception, then program tries to connect again - this usually
helps.
However after some number of exceptions the reconnect is not working
anymore. Always cannot connect to Webservice.
Why is is so? Is it because i cannot connect to webservice with such a high
rate?? If so ... why??
Here is the simple code of my DownloadWorker

private void downloadWorker_ DoWork(object sender, DoWorkEventArgs e)

{

using (FileStream fs = new
FileStream("tes t",FileMode.Cre ate,FileAccess. Write))

{

while (Offset < FileSize && !downloadWorker .CancellationPe nding

{

try

{

byte[] Buffer = myObj.DownloadC hunk(this.FileN ame, this.Offset, 16*1024);

fs.Write(Buffer , 0, Buffer.Length);

this.Offset += Buffer.Length; // save the offset position for resume

}

catch (Exception ex)

{

//MessageBox.Show (ex.Message);

//throw new Exception("Erro r occurred during upload, too many retries.\r\n"
+ ex.Message);

}
// update the user interface by reporting progress.

downloadWorker. ReportProgress( (int)(((decimal )Offset / (decimal)FileSi ze) *
100));

}

}

}

thanks for any suggestions

PK
Mar 25 '07 #1
0 1138

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3569
by: Bart Nessux | last post by:
def windows(): import os excludes = size_list = for root, dirs, files in os.walk('/'): total = for t in total: s = file(os.path.join(root,t)) size = s.read() size_list.append(size)
5
2511
by: Liensun | last post by:
The application is coded using ASP.net and C#. A part of the application allows the user to download files. The size of these field can be up to 80 MB. It works when the connection bandwidth is high. But in other cases, after a few minutes, the next messages is displayed: "The connection with server was reset". Here the code that I use: private void SendPageToBrowser(string filename)
26
16540
by: Rajeev Tipnis | last post by:
http://support.microsoft.com/default.aspx?scid=kb;en- us;819450 Questions: 1) Is this patch (fix) applicable to the .NET 1.1 Framework as well? That is, if we have Framework 1.1 (On Win2K3/IIS6.0), do we still need this patch? 2) Does it specifically solve only this error: The underlying connection was closed. An unexpected error
1
8898
by: Fredrik L | last post by:
Hi, We have an application outside the firewall who talks to a webservice inside the firewall. 9 times of 10 this works, but sometimes we got the error "The underlying connection was closed: An unexpected error occurred on a receive." We have tested some of the solutions that we have found in this discussion group but the problem still exist. We use .NET Framework 1.1. The application server use Win2003. The webservice server use...
5
24779
by: Vijayakrishna Pondala | last post by:
Hi, We are using the following error randomly, when accessing a webservice method/servlet hosted on JBoss application server: The underlying connection was closed: An unexpected error occurred on a receive. We are using .NET v1.1.
4
6215
by: jf li | last post by:
I have a Asp.net web application and a Asp.net Web service application. The Web application is using HtmlInputFile to get a 50M size of file selected by end user, read the data of this file and pass the data to the web service. I already modified both web.config files and changed maxRequestLength to 60000(kb). When I debug the upload process, it seems the Web application can get the 50M file and read the data without problem, but when the...
0
1578
by: Mahesh Devjibhai Dhola | last post by:
Hi, I am getting the following exception when using webservice.. "The underlying connection was closed: An unexpected error occurred on a receive" I am not getting any innerexception so no clue for the reason. While i was seaching on web, i found the solutions but its not working for me. I have already override the method on client proxy but its not working, protected override System.Net.WebRequest GetWebRequest(Uri uri) {
4
21809
by: =?Utf-8?B?QXJuYXVkIFZpc2N1c2k=?= | last post by:
Hi all, we meet a problem since we use WCF to consume java WebServices. Often the first call works then the second raises the following error : "The underlying connection was closed : " We use a basicHttpBinding over HTTPS to connect to WebService. The configuration is the following <binding name="SoapBinding" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:02:00"
0
9734
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10395
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10408
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9211
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7674
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6895
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5564
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5700
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3876
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.