<<Urgent>> HttpModule, WebService

Discussion in 'ASP .Net Web Services' started by NET_NET_2003, Aug 25, 2003.

  1. NET_NET_2003

    NET_NET_2003 Guest

    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
     
    NET_NET_2003, Aug 25, 2003
    #1
    1. Advertising

  2. NET_NET_2003

    Frank Drebin Guest

    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" <> wrote in message
    news:...
    > 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" <> wrote in message

    news:<h1p2b.33064$>...
    > > 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" <> wrote in message
    > > news:...
     
    Frank Drebin, Aug 25, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. sunnyz
    Replies:
    1
    Views:
    356
    Victor Garcia Aprea [MVP]
    Oct 24, 2004
  2. Sachin Jagtap

    URGENT !! QUEUE STL PROBLEM URGENT!!

    Sachin Jagtap, Apr 28, 2005, in forum: C++
    Replies:
    4
    Views:
    1,045
    Mark Stijnman
    Apr 29, 2005
  3. aka

    Webservice problem url urgent

    aka, Aug 1, 2006, in forum: ASP .Net Web Services
    Replies:
    4
    Views:
    142
  4. Rob
    Replies:
    3
    Views:
    440
  5. Replies:
    1
    Views:
    268
Loading...

Share This Page