Hi,
I don't think that IsClientConnected would work, I'll show some code:
public class ModuleTest : IHttpModule
{
public void Init(HttpApplication httpApp)
{
httpApp.BeginRequest += new EventHandler(this.OnBeginRequest);
httpApp.EndRequest += new EventHandler(this.OnEndRequest);
}
public void OnBeginRequest(object o, EventArgs ea)
{
HttpApplication httpApp = (HttpApplication) o;
httpApp.Response.Write("BeginRequest started <br/>");
//and may perform also something else
}
//After the data has been sent to client,
//I want to call a specific method.
//The event EndRequest will be fired when the worker
//process has finished his job,
//and doesn't mean that the client has received data.
//So I tried the following:
public void OnEndRequest(object o, EventArgs ea)
{
HttpApplication httpApp = (HttpApplication) o;
while(httpApp.Response.IsClientConnected)
{
}
httpApp.Response.Write("Client is no more connected<br/>");
}
}
But this did not work, it never returns
I hope that somebody would be able to help
Thanx