Click here to Skip to main content
15,889,767 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Posted

1 solution

Are all of the calls on the same port? If so, that's why it's blocking.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900