[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

NET_NET_2003

8/25/2003 2:22:00 PM

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
1 Answer

Frank Drebin

8/25/2003 8:07:00 PM

0

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?


"NET_NET_2003" <NET_NET_2003@hotmail.com> wrote in message
news:526ed31c.0308251148.58e9b597@posting.google.com...
> first, thanx for ur participation :)
>
> I have a DLL, with which I can create filters in my network card to
> perform some tasks on the packets leaving.
> When a request arrives to my Web Service,the Web Service(or Module, or
> somebody else) calls the "Create_filter" function of this DLL, and
> after the request has been sent, Web Service (or Module, or somebody
> else) must remove this filter calling "Remove_filter" function of the
> DLL.
>
> Creating is no problem (event BeginRequest), but I can't remove the
> filter when the event EndRequest is fired because the stream is still
> in the above layer, i.e. data has not been (maybe not compeletly)
> sent. I need to know, that data is out.
>
> Thanx
>
>
> "Frank Drebin" <noemail@imsickofspam.com> wrote in message
news:<h1p2b.33064$Vx2.14415533@newssvr28.news.prodigy.com>...
> > I'm not clear on what you said, let me see if I can recap:
> >
> > -a client attaches to your webservice
> > -the web service returns data
> > -you need to do something useful when the web service finishes returning
the
> > data?
> >
> > If so - in the WebMethod, why not put your code in there?
> >
> > "NET_NET_2003" <NET_NET_2003@hotmail.com> wrote in message
> > news:526ed31c.0308250621.f9ef2c@posting.google.com...