Hm if I get you I can suggest the following:
Every connected servent should keep a ID list where you put in the ID of queries. When you receive a hit you just check your servents for the ID. If it contains the ID you know where to send it. To prevent loops you have to check that you don't have an ID twice in your lists. I mean that is really not to hard to do. On all systems there are libraries offering hashes or vectors... so this should be fast and efficient. |