none
Launch Remote Client from WCF Network Service RRS feed

  • Question

  • Hi all,

    I'm looking for a way to launch a remote client from my WCF Network Service. If the service detects that the IP is still up but no longer running the client I want to force the client machine to relaunch the client app.

    I have the client IP obviously - so is there any easy way to do this?

    Regards,

    Jib

    Thursday, November 28, 2013 1:21 PM

Answers

  • Hi,

    Maybe you should use the sessionful channels. Then the service would be aware of when the client closes the channel. This can be tracked by implementing IChannelInitializer and IContractBehavior

    • Implement IChannelInitializer and IContractBehavior
    • In IChannelInitializer.Initialize, subscribe to Channel.Opened and Channel.Closed events to know when the service channels are being created and destroyed.
    • In IContractBehavior.ApplyDispatchBehavior, add the IChannelInitializer to the dispatchRuntime

    Now, when the client channel disconnects, the service is notified (for sessionful channels) and the Channel.Closed event is called. This would help your service code to detect when the client dies down and relaunch the client app.

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, November 29, 2013 5:14 AM
    Moderator

All replies

  • Hi,

    Maybe you should use the sessionful channels. Then the service would be aware of when the client closes the channel. This can be tracked by implementing IChannelInitializer and IContractBehavior

    • Implement IChannelInitializer and IContractBehavior
    • In IChannelInitializer.Initialize, subscribe to Channel.Opened and Channel.Closed events to know when the service channels are being created and destroyed.
    • In IContractBehavior.ApplyDispatchBehavior, add the IChannelInitializer to the dispatchRuntime

    Now, when the client channel disconnects, the service is notified (for sessionful channels) and the Channel.Closed event is called. This would help your service code to detect when the client dies down and relaunch the client app.

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, November 29, 2013 5:14 AM
    Moderator
  • And I wish to trigger this re-launch from the server and not the client machine. I.e start the client.exe process on the client machine, from the server/service.
    Sunday, December 1, 2013 6:17 PM
  • Sorry, my replies keep getting filled with weird mark-up so I've moved to another machine.

    I am already detecting when a client has not checked in with the service. From then I send a ping over to the client to see if it's still alive. If it is then I can assume that the client process has been killed or has just failed - in which case I'd like to trigger a restart from the service.
    Tuesday, December 3, 2013 9:32 AM