<<Urgent>> HttpModule, WebService

N

NET_NET_2003

Hi,
I have a DLL that does something with the network interface. When My
Web Service receives a request, a function of this DLL will be called,
and after the data has been sent to the client, another function will
be called. So it is important to know, when the data has been already
sent.
For the first situation it is not a problem bec a request will be
received, but the problem is in the second case
So I thought, an HttpModule may help, and here is some code:

---------------
Global.asax
---------------
<%@ Application Codebehind="Global.asax.cs" Inherits="ModuleWS.Global"
%>

-------------------
Global.asax.cs
-------------------
protected void Application_EndRequest(Object sender, EventArgs e)
{
HttpApplication httpApp = (HttpApplication) sender;
httpApp.Response.Flush();
//while(httpApp.Response.IsClientConnected)
//the client is always connected until it gets all traffic,
// that is logical, so this will not return
while(httpApp.Response.OutputStream.Length > 0)
{
//System.Threading.Thread.Sleep(20);
}
}
-------------------------------------------------------------------------------

when I include this, the client will break down, bec. it doesn't
receive any answer. Any ideas??? even when u have another solution, I
need a way that tells me that the WebService has sent the data to the
client.
Thanx
 
F

Frank Drebin

It seems you still want to keep things very transactional - even at this
higher (application level).

You could make the client so that it sends a response back to the server
when it has acknowledged what you sent.. so:

Caller->Server: "Gimme data"
Server: AddFilter
Server->Caller: Return "data"
Caller->Server: Ack Data - thanks!
Server. RemoveFilter

What about that?
 

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,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top