Upload failed : java.net.SocketException: Connection reset b

Upload core product.
amrish_deep
Posts: 40
Joined: Tue Jun 17, 2008 5:14 am

Upload failed : java.net.SocketException: Connection reset b

Post by amrish_deep »

I could upload small files with out this error. But could not upload big files (100MB) .My server side log stops at a point when the server is proceeding to receive file from client. After that nothing happens. I am using httpmethod with PUT and my server side code in C#.

User avatar
support
Posts: 1503
Joined: Sun Jan 27, 2008 6:19 pm

Re: Upload failed : java.net.SocketException: Connection reset b

Post by support »

Is it exactly 100MB or around? If around it maybe a time out issue.
Check you Web.config file first and IIS settings.

Are you using the ASP.NET script available at:
http://www.jfileupload.com/products/tools/index.html

amrish_deep
Posts: 40
Joined: Tue Jun 17, 2008 5:14 am

Re: Upload failed : java.net.SocketException: Connection reset b

Post by amrish_deep »

My session timeout in application web.config is 2400 minutes. Execution time out in web.config particular to upload is 43200. So time out is not an issue. I have been logging in the code in PUT method.Please check the code below.The logging ends at "proceeding the receive file from client".Then it logs another line with file path on the server. After which I create the output file stream object. Then buffer the input file stream and calculate the input file stream length.I log the length of input strem calculated. But it doesnot get excecuted when the file size is >25MB.
Log.Message(MessageType.INFO, "[ " + userData.GetLoginName()
+ " ] PROCEEDING THE RECEIVE FILE FROM CLIENT");


if (contentrange != null)
{
Log.Message(MessageType.INFO, "[ " + userData.GetLoginName()
+ " ] "+contentrange);
contentrange = contentrange.Substring(6, contentrange.Length - 6);
contentrange = contentrange.Substring(0, contentrange.IndexOf("-"));
skip = Int64.Parse(contentrange);
fout = new System.IO.FileStream(filepath, System.IO.FileMode.Open, System.IO.FileAccess.ReadWrite);
fout.Seek(skip, System.IO.SeekOrigin.Begin);
}
else
{
Log.Message(MessageType.INFO, "[ " + userData.GetLoginName()
+ " ] "+filepath);
fout = new System.IO.FileStream(filepath, System.IO.FileMode.Create, System.IO.FileAccess.ReadWrite);
}

buffer = new Byte[4096];
fin = Request.InputStream;
int read = -1;

//THE ACTUAL SIZE THAT WAS UPLOADED TO THE SERVER
sizeUploaded = fin.Length;

Log.Message(MessageType.INFO, "[ " + userData.GetLoginName()
+ " ] TOTAL SIZE OF FILE THAT WAS UPLOADED IN THIS SESSION :" + sizeUploaded + "BYTES");

Log.Message(MessageType.INFO, "[ " + userData.GetLoginName()
+ " ] FINISHED RECEIVING FILE FROM CLIENT");

User avatar
support
Posts: 1503
Joined: Sun Jan 27, 2008 6:19 pm

Re: Upload failed : java.net.SocketException: Connection reset b

Post by support »

Ok, it seems to be a size issue. Could you confirm that 24MB is fine and 26MB fails?
Notice that timeout in web.config in not the only time out. You have other in IIS.

What do you have for maxRequestLength in your Web.config? In our sample it's 2MB.

<configuration>
<system.web>
<httpRuntime maxRequestLength="2097151" executionTimeout="36000"/>
</system.web>
</configuration>

amrish_deep
Posts: 40
Joined: Tue Jun 17, 2008 5:14 am

Re: Upload failed : java.net.SocketException: Connection reset b

Post by amrish_deep »

The httpruntime tag in web.config is <httpRuntime
executionTimeout = "43200"
maxRequestLength = "2097151"
requestLengthDiskThreshold = "4000" />

The IIS setting also has been set for 3600 as time out.Please help me why the socket is getting closed. Is there any other IIS setting on which applet relies?

User avatar
support
Posts: 1503
Joined: Sun Jan 27, 2008 6:19 pm

Re: Upload failed : java.net.SocketException: Connection reset b

Post by support »

Try to increase maxRequestLength. As you said it's "2097151" and don't understand how you can upload file > 2 MB.

amrish_deep
Posts: 40
Joined: Tue Jun 17, 2008 5:14 am

Re: Upload failed : java.net.SocketException: Connection reset b

Post by amrish_deep »

But we were usibg the same request length from long back and we could upload 2GBfiles also.What does this http request length actually mean?

User avatar
support
Posts: 1503
Joined: Sun Jan 27, 2008 6:19 pm

Re: Upload failed : java.net.SocketException: Connection reset b

Post by support »

It's the maximum size for HTTP POST upload. But I've just realized that you're using HTTP PUT so it's not a problem. So what is the size limit you notice? 25MB exactly ?

amrish_deep
Posts: 40
Joined: Tue Jun 17, 2008 5:14 am

Re: Upload failed : java.net.SocketException: Connection reset b

Post by amrish_deep »

The size is very inconsistent. Sometimes it fails for 25MB, sometimes for 50MB, sometimes 100MB. Upload happens till some extent (say 10% or 20% or 50 or 80%). Even this value is inconsistent.
The problem is that same code works at one place (in test server) and throws exception at other place (in production server). Is there any other applet setting or configuration that i should take care of while deploying the site?

User avatar
support
Posts: 1503
Joined: Sun Jan 27, 2008 6:19 pm

Re: Upload failed : java.net.SocketException: Connection reset b

Post by support »

No, there is no other parameter. What are the differences between test and prod servers ?
Any new firewall settings?

Post Reply