Re: Can anyone help de-confuse me about CORBA
>>>>> On Mon, 19 May 2003 18:34:16 +0100, Tim Bradshaw <tfb@cley.com> said:
Jason> Just set both programs up as proper servers. You say you
Jason> can do one so two must be trivial.
Tim> Well, no. Or rather, maybe. The server sits on a port at some level,
Tim> and it's not completely clear how to get it to sit on another port
Tim> (since they generally are on the same host) although this may be the
Tim> right thing to do.
Yes, each server will need it own port. See the doc, or the replies
from AlainP and DavidY.
Jason> Then have the 'client' call the 'server' and pass an object
Jason> reference representing its own 'client' service. You say
Jason> you have created a pure client-server system so you must
Jason> have had to create an object reference and eg write the
Jason> stringified form out into a file or somewhere to pass to
Jason> the client. Instead of stringifying it you need to just
Jason> pass it in a call. Should be even simpler. ( Of course, if
Jason> you have been relying on the client magically making up the
Jason> reference to the server because you know the port,
Jason> hostname, and the fact that it is the same ORB then this
Jason> will be a new hurdle for you. )
Tim> I currently create an IOR, and stringify it in the initial
Tim> server, dumping it to a file. the client then snarfs that
Tim> IOR and talks in the normal way. I think I can pass object
Tim> references around OK - at least I've done this for other
Tim> things, what I can't do is make it be the case that the two
Tim> servers (two ORBs, I guess) understand each other.
Okay. It just sounds like the services port numbers are clashing.
Tim> The rest of what I'm trying to do is exactly what you
Tim> describe - the server maintains a list of listeners, and
Tim> calls them back (removing any that are no longer extant,
Tim> either on request or because of an error in the call).
You might also want to later add regular liveness pings on the
registered consumers so that you can clean them up more eagerly.
Tim> But it may be that this comes down to a Windows lossage
Tim> problem. I've just tried it on Linux, and now I get a
Tim> `cannot bind port' error, which is what I should get, I
Tim> think, since the two ORBs can't coexist on the same port.
Tim> What I got on Windows was ... nothing: initialising the ORB
Tim> worked fine, but then on the `client' it got completely
Tim> mutant errors (`this object does not exist') when trying to
Tim> pass the reference. So I probably need to (a) give up on
Tim> Windows (*how* are you meant to tell, in Windows, if a port
Tim> is in use or not?), and do the `look for a free port' thing
Tim> on Linux.
It should work once you assign separate ports.
In other CORBA implementations there are Implementation Repositories
(activation daemons) which sit on the one and only fixed port in the
system and which manage the starting of all the other services on
OS-assigned port numbers.
__Jason