How to check the availability of a net.tcp WCF service

前端 未结 5 1703
失恋的感觉
失恋的感觉 2020-12-14 03:10

My WCF server needs to go up and down on a regular basis, the client sometimes uses the server, but if it is down the client just ignore it. So each time I need to use the s

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-14 04:02

    If you are doing a synchronous call expecting a server timeout in an application with a user interface, you should be doing it in another thread. I doubt that the performance hit is due to exception overhead. Is your performance penalty in CPU load, gui availability or wall clock time?

    You could investigate to see if you can create a custom binding on TCP, but with faster timeout.

    I assume you know that "IsOneWay=true" is faster than request->response in your case because you wouldn't be expecting a response anyway, but then you are not getting confirmation or return values. You could also implement a two-way communication that is not request->response.

提交回复
热议问题