[JDEV] Transports new approach

Dennis Noordsij dennis.noordsij at wiral.com
Tue Dec 12 10:35:24 CST 2000


Hi,

This is partly in reply to Keith's description of the new (MIO) way of doing 
instances and transports.

What I want to do:
I have a normal plain old jabber 1.2 server, working just fine. I have added 
a <service> section to handle certain types of messages sent to it and used a 
Perl script as that service, worked fine. (the messages got sent via tcp/to 
perl, perl replied with xml, all was good).

Now I want to convert the Perl version to a C version. I would like to make 
use of course of the jabber code for xml building and session handling etc. 
>From the information in the example-transport code it appears to be quite 
easy to write the service I have in mind.

However, I do not want this service to be run on the same machine as my 
"main" jabber, because that one is busy enough as it is. Instead I would like 
it to connect to it via TCP/IP from another machine.

My uneducated guess was that the 2 jabberd programs, the main one and the one 
using my loadable module would connect and all would be good. It's a little 
trickier though :-)

I have the exact same <service> announcement in the main jabber.xml file.

Now I need to create the anotherjabber.xml file, which has a <connect> part 
to connect to the main jabber and to register itself there (say for example 
its name should be "myinstance" and any messages sent to 
"[anyone@]myinstance" should be routed to it. 

If I use a very simple anotherjabber.xml file, a la:

<service id="myinstance">
 <host/>
 <connect>
    ....
 </connect>
 <load><runcomponent>./src/component.so</runcomponent></load>
</service>

then it appears to connect to the main jabber nicely, but as soon as I send a 
message to "myinstance" the 2 jabbers start sending the message to each other 
as fast as they can. Note it doesn't bounce, but the second jabber simply 
sends it back to the first one, and the first one routes it back to the 
second one.

I have played with different configuration options, adding some modules to 
the second jabber, etc, but what I am trying to do should be quite simple.

An example .xml file for the "myinstance" jabber to accomplish what I am 
trying to do would be very very much appreciated!

Kind regards,
Dennis




More information about the JDev mailing list