Detecting Client Death in WCF Duplex Contracts

后端 未结 2 1758
星月不相逢
星月不相逢 2020-11-29 19:44

I\'m trying to build a SOA where clients can perform long running queries on the server and the server responds using a callback.

I\'d like to be able to detect if t

2条回答
  •  暖寄归人
    2020-11-29 20:24

    try this to check if the callback object is still valid:

    (((ICommunicationObject)myCallbackObject).State == CommunicationState.Opened)
    

    myCallbackObject in this case is the object through which you can perform the callback, i.e. the one implementing the callback contract

提交回复
热议问题