Fire event when client connects to WCF-hosted endpoint

后端 未结 2 785
隐瞒了意图╮
隐瞒了意图╮ 2021-01-02 03:52

What do I do in order to fire an event when a new client connects to WCF-hosted service?

EDIT: What I\'m looking is to get an event when a new session is created or

2条回答
  •  一向
    一向 (楼主)
    2021-01-02 04:19

    Depends on your set up - do you do "per call" conversations? Then you don't really get any "client now connected" message per se....

    Do you do session-based conversations? Your "ServiceHost" class has two events "Opening" and "Opened", which you can hook into, especially if you self-host your service.

    What exactly is it you want to achieve by trapping this event?

    Marc

提交回复
热议问题