This is a discussion on Having connection timeout problem when calling a php script while downloading a file from the same server. within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Hi, My dot net client downloads files and checks for any new files time to time. The server is apache2....
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi,
My dot net client downloads files and checks for any new files time to time. The server is apache2.0.53 server. So what happens is that my file download thing works fine if I dont try to call any page from the server while downloading. If I try to call a single page while downloading a file then the page request goes time out and the server then closes the existing download stream and the client doestn't throw any exception. So many a time I end up with incomplete downloaded file. The server side code is in PHP and every thing like calling a page or downloading a file is done by calling some PHP script. What is the reason behind this type of behaviour.Has this anything to do with PHP and server settings. Thanx. |
|
|||
|
just.starting@gmail.com wrote:
> Hi, > My dot net client downloads files and checks for any new files time to > time. The server is apache2.0.53 server. So what happens is that my > file download thing works fine if I dont try to call any page from the > server while downloading. If I try to call a single page while > downloading a file then the page request goes time out and the server > then closes the existing download stream and the client doestn't throw > any exception. So many a time I end up with incomplete downloaded file. > The server side code is in PHP and every thing like calling a page or > downloading a file is done by calling some PHP script. > > What is the reason behind this type of behaviour.Has this anything to > do with PHP and server settings. If it did with other clients, it would be useless as a web server. A real web session will begin by loading, say a web page and begin parsing it. It may then use the same socket connection (if keep-alive is enabled) to start downloading a CSS file referenced by the page and open a new socket to start downloading an image. Many seperate machines may use the same proxy - but the webserver canot differentiate between them. If you really tried you could configure apache to only allow one request at a time, but it still wouldn't behave like this (subsequent requests would back up until the first request finished or timed out). > My dot net client Ahh. Microsoft. That's half the problem. The problem is certainly client-side - you seem to be using the same instance of the downloader to download more than one file - which it obviously is not capable of. HTH C. |
|
|||
|
Ahh. Microsoft. That's half the problem.(Nice one:( )
Can you tell me how the server side is configured like how many connections per client to server is allowed. I think it should be like max connection per session or something like that. For example all the people behind NAT can connect to server and if there is a MAX limit on the number of connections per ip to host, then if there are a lot of people behind the same NAT then the server will block the others who come to it after others. Thanks. |
|
|||
|
Ahhhhhhhhhhh....
There is another problem. I have kept some files at the server for testing purpose. There is one particular file arnd 3KB in size. I can download other files fine(in case I dont access any other page in between). But in case of that particular file the client disconnects saying Unable to read data from transport connection. That means the connection is being closed arbitrarily. But downloading other files just works fine. Need some help here. Thanks. |