Windows Vista Forums

Knowing when a service dies
  1. #1


    sebastian.dau Guest

    Knowing when a service dies

    Hello Newsgroup,

    I wonder how one would write wcf proxy code that is being notified
    when the connected service channel is being closed (service process
    ends for example).

    I was subscribing the Channels and the Duplex Channels Closing and
    Closed events but these have never been fired.

    Any idea on that?

    Thanks for you help!

    Sebastian


      My System SpecsSystem Spec

  2. #2


    Nahid Guest

    Re: Knowing when a service dies

    hi,
    try following way

    YourServiceCF = new ChannelFactory<IYourService>
    (...........................);
    IYourService client = YourServiceCF .CreateChannel();
    ((ICommunicationObject)client).Faulted += new
    EventHandler(Faulted);
    or
    ((ICommunicationObject)client).Closed += new
    EventHandler(Faulted);

    hope this help.
    thanks
    nahid
    http://nahidulkibria.blogspot.com/


    On May 2, 8:40*pm, "sebastian....@xxxxxx"
    <sebastian....@xxxxxx> wrote:

    > Hello Newsgroup,
    >
    > I wonder how one would write wcf proxy code that is being notified
    > when the connected service channel is being closed (service process
    > ends for example).
    >
    > I was subscribing the Channels and the Duplex Channels Closing and
    > Closed events but these have never been fired.
    >
    > Any idea on that?
    >
    > Thanks for you help!
    >
    > Sebastian
      My System SpecsSystem Spec

  3. #3


    sebastian.dau Guest

    Re: Knowing when a service dies

    On May 7, 11:51 am, Nahid <nahid...@xxxxxx> wrote:

    > hi,
    > try following way
    >
    > YourServiceCF = new ChannelFactory<IYourService>
    > (...........................);
    > IYourService client = YourServiceCF .CreateChannel();
    > ((ICommunicationObject)client).Faulted += new
    > EventHandler(Faulted);
    > or
    > ((ICommunicationObject)client).Closed += new
    > EventHandler(Faulted);
    >
    > hope this help.
    > thanks
    > nahidhttp://nahidulkibria.blogspot.com/
    >
    > On May 2, 8:40 pm, "sebastian....@xxxxxx"
    >
    > <sebastian....@xxxxxx> wrote:

    > > Hello Newsgroup,
    >

    > > I wonder how one would write wcf proxy code that is being notified
    > > when the connected service channel is being closed (service process
    > > ends for example).
    >

    > > I was subscribing the Channels and the Duplex Channels Closing and
    > > Closed events but these have never been fired.
    >

    > > Any idea on that?
    >

    > > Thanks for you help!
    >

    > > Sebastian
    Thanks,

    that worked as required.

    Best Regards, Sebastian
      My System SpecsSystem Spec

Knowing when a service dies problems?

Similar Threads
Thread Thread Starter Forum Replies Last Post
Farrah Fawcett Dies. Bare Foot Kid Chillout Room 12 30 Jun 2009
How can I change IP Adapters WITHOUT knowing exactly what thedescription is? GBPackerBacker VB Script 2 05 Jun 2009
Computer dies Viv Vista hardware & devices 5 28 Jul 2008
Knowing when a WCF service dies... sebastian.dau .NET General 0 03 May 2008
Knowing version installed Jaisol Vista General 5 14 Oct 2006