确保只与Web服务建立了一个连接 [英] Make sure only one connection is made to a web service
本文介绍了确保只与Web服务建立了一个连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我有一个c#web服务,可以在构建过程中由不同的机器使用。如何确保一次只能与Web服务建立一个连接?我记得使用互斥锁,但我确信只能确保一个进程的一个实例在一台计算机而不是一个Web服务上运行。任何想法?
谢谢大家!
Hi All,
I have a c# web service that is goign to be used by different machines during a build process. How can i ensure that only one connection is made to the web service at any one time? I remember using mutex's but im sure that only ensure one instance of a process is running on a single computer rather than on a web service. any ideas?
Thanks guys!
推荐答案
你应该在这些答案中使用锁定:
如何仅限限制HttpModule每次请求一次通话? [ ^ ]
如何一次限制一个方法调用? [ ^ ]
You should use locking like in these answers :
How to limit HttpModule with ONLY ONE call per request?[^]
How to restrict to one method call at a time?[^]
这篇关于确保只与Web服务建立了一个连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文