ReadEntityBody problem

G

Guest

I'm trying to read files from the request using the ReadEntityBody method on the HttpWorkerRequest

Most of the time it works fine to get chunks from the request but sometimes it takes a long time before this function returns and it doesn't read any bytes. The return value is 0 bytes read

I also check IsClientConnected() on the request to avoid reading a closed request

What could be the possible cause or beter a solution for this problem

Kind Regards
Bjorn
 
B

bruce barker

Welcome to the internet. This is perfectly normal behavior. ReadEntityBody
gives you access to pipe of input data IIS is sending to the asp.net worker
process. As IIS recieves data on its tcp/ip connection, it send a copy to
the asp.net worker process thru a named pipe. How fast the data comes it
based on the client. Also as the client generally does not have a direct
link to the server (usually many proxies and routers), a connection loss
will not be noticed on IIS. It can not detect the connection is lost until
it sends a response. So generally you timeout the connection to handle this
case.


-- bruce (sqlwork.com)




Bjorn B said:
I'm trying to read files from the request using the ReadEntityBody method on the HttpWorkerRequest.

Most of the time it works fine to get chunks from the request but
sometimes it takes a long time before this function returns and it doesn't
read any bytes. The return value is 0 bytes read.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top