简体   繁体   English

WCF timout是否中止当前操作?

[英]WCF timout that abort the current operation?

I have tried to set sendTimeout, receiveTimeout and the httpRuntim executionTimeout on our WCF (IIS7/TCP/WAS) application service. 我试图在WCF(IIS7 / TCP / WAS)应用程序服务上设置sendTimeout,receiveTimeout和httpRuntimexecutionTimeout。

The timeout works but the operation will continue to run, what we need is to get the operation aborted. 超时有效,但是该操作将继续运行,我们需要的是中止该操作。

In this case there could be a deadlock or anything like that and to solve this problem as fast as possible it would be great if we could abort operations that goes on to long, those operations do lock calls from other clients that's why it needs to be aborted. 在这种情况下,可能会出现死锁或类似的死锁,并且要尽快解决此问题,如果我们可以中止持续很长时间的操作,那就太好了,这些操作会锁定来自其他客户端的调用,这就是为什么需要这样做流产了。

Run the job on a 'background' thread or use some other mechanism like that and simply ignore the results from the network call based on some 'stop' flag. 在“后台”线程上运行作业,或使用类似的其他机制,并基于一些“停止”标志仅忽略网络调用的结果。

I've used a little job system working with tickets based on GUID's that simply did not raise 'Complete' events if the job was stopped. 我使用了一个基于GUID的票证工作系统,如果该工作被停止,它根本不会引发“ Complete”事件。

Aborting the actual network call is potentially unsafe. 中止实际的网络呼叫可能不安全。 You might kill a function in some critical networking code path that breaks the driver/os/whatever code. 您可能会在某些关键的网络代码路径中终止某个功能,该功能会破坏驱动程序/操作系统/所有代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM