1

When a DuplexChannelFactory is created with 'CreateChannel()' the status is 'Created', this state only means the duplex connection request is ready to be connected. The problem is that when calling 'Open()' if the server isn't available the DuplexChannelFactory is simply set to Faulted, this affects my handling because I'm subscribing to the Faulted event for general method failures but not a general connection issue.

My question is: How can I check if the duplex server is available before calling 'Open' and going into a faulted state? Or is there a way to find the faulted reason so I can respond correctly to the issue?

Dan Hall
  • 1,474
  • 2
  • 18
  • 43
  • You can use this code to determine the status of the channel: if (client.InnerChannel.State == CommunicationState.Faulted) { } – Ding Peng Jun 18 '20 at 03:00
  • There isn't yet a channel to check. Please read the question again. – Dan Hall Jun 22 '20 at 14:06
  • After testing, I found that we can't check whether the server-side is running normally through the channel of the client-side. If the server is abnormal, the channel state of the client will not change. In short, once the client-side channel is successfully created, it is not related to the server-side. – Ding Peng Jun 24 '20 at 08:18

0 Answers0