Hm, I answer to myself, after thinking some more ;-)
Le 05/09/2012 21:04, Alexandre Jousset a écrit :
1) A minor one: is it right that it's a typo when you wrote example.org instead of example.com at some places?
Obviously, yes.
2) Is is OK to assume that all non full-JIDs are of priority 0 (or, better said, have no priority at all)?
Obviously, yes.
3) I have a doubt when you say at different places that a component needs to bind bare-JIDs / full-JIDs "from now on". Does that mean that it needs to send bind requests for all sessions it already has, or just make *new* bind requests of the type you mentioned?
I think the component has to send all its already online sessions. And I think this can be a hint for the routers' synchronisation in multi-router implementation. In a multi-router implementation, why not consider a router as a more or less "normal" component (when connected to other routers)? With one exception, that when a random has to be chosen between components, only the local components have a chance. I have to think more about this...
4) In this process, what if component1 disconnects? I suppose that the router needs to crawl through its tree to update it, but that can be CPU intensive and can cause lags... I know that this event is not a "normal" event anyway and is not supposed to happen often, so it can be negligible. 5) A Jabber protocol question, I know I could find the answer in the online docs, but as I have you at hand ;-) Is it possible to have 2 full-JIDs connected at the same time? With equal or different priorities? I suppose the answer is "no" to both questions, but just to be sure...
Obviously, no.
6) The tree structure I'm thinking about uses hashes to find the next node (root => domain => user => resource), and finally a pointer or an array of pointers to components for the leaves. If the answer to previous questions at 5) is "no", there is only one case where there can be more than one leaf: at each node is a "default route" leading to one or more components. If I use a static sized array to store them, that will use more memory. So the best would be to use a linked list, but that would make the process slower. I would tend to use linked lists because the cases where one has to crawl through them are (relatively) less frequent. What do you think?
Stupid question: the case where there is multiple choice for components is only the "domain" case. So I can use a reasonnably configurable-at-compile-time sized array. -- -- \^/ -- -- -/ O \--------------------------------------- -- -- | |/ \| Alexandre (Midnite) Jousset | -- -- -|___|--------------------------------------- --