递归WCF调用块 [英] Recursive WCF call blocks

查看:88
本文介绍了递归WCF调用块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用WCF建立结构化覆盖网络的框架,以支持传输层.每个应用程序都包含一个WCF服务的单例实例,用于通过应用程序发送和接收消息.该服务使用NetTcpBinding,在ConcurrencyMode中运行.多个会话模式被禁用,并且该服务的操作都是一种方式.
我在此路由框架上实现了Kademlia算法,即使在10个实例中同时进行了100次调用,迭代调用(Kademlia中的FIND_NODE和FIND_VALUE)也能很好地工作.
senario是:
假设有4个应用程序(节点),一个(节点A)尝试在网络上(其他3个节点)递归存储字符串.首先,它使用FIND_NODE(一个迭代调用,将涉及所有其他3个节点)操作来查找最接近要存储的字符串的前2个字符的键的20个(在这种情况下为3个)节点.然后,它将字符串发送到找到的节点.接收到该字符串的节点将存储此字符串,然后删除该字符串的第一个字符,并执行与节点A相同的行为.
如果有3个节点,则上面的senario可以正常工作.但是,如果有4,则操作开始阻塞.并且如果字符串足够长,也会在WCF上导致超时异常.
该服务异步处理呼叫,所有呼叫也异步进行.我只是感到困惑是如何发生的.有人知道吗?
在此先感谢并感谢您发的冗长.

I am building a framework of structured overlay network using WCF for transport layer support. Each application holds a singleton instance of WCF service for sending and receiving messages from over applications. The service uses NetTcpBinding, runs in ConcurrencyMode.Multiple, session mode is disabled and operations of this service are all one way.
I implemented Kademlia algorithm on this framework for routing, and iterative calls(FIND_NODE and FIND_VALUE in Kademlia) work pretty well even if 100 calls are made in the same time among 10 instances.
The senario is:
Assume there are 4 applications(nodes), and one(node A) try to store a string recursively on the network(other 3 nodes). Firstly, it uses FIND_NODE(an iterative call, all other 3 nodes will be involved) operation to find 20(in this case, 3) nodes nearest to the key of the first 2 chars of the string to store. Then, it send the string to the nodes it found. Nodes that received the string will store this string, then remove first char of the string, and perform the same behaviour like node A.
If there are 3 nodes, the senario above works fine. But if there are 4, operations begin to block. And if the string is long enough, will also cause a time out exception on WCF.
The service handles calls asynchronously and all calls are also made asynchronously. I''m just confused how the block happened. Does anyone has any idea?
Thanks in advance and sorry for the long post.

推荐答案

所有呼叫是否都在同一端口上?如果是这样,那就是它被阻止的原因.
Are all of the calls on the same port? If so, that''s why it''s blocking.


这篇关于递归WCF调用块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆