ReadEntityBody problem

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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.
 
Back
Top