« Return to Thread: multiple jvms on one host using slp server

Re: multiple jvms on one host using slp server

by simonebordet :: Rate this Message:

Reply to Author | View in Thread

Hi,

On Thu, Jun 19, 2008 at 9:30 PM, Mark Libucha <mlibucha@...> wrote:
> I'm having a little trouble understanding how I'd have multiple JVMS acting
> as SLP servers on the same host. Since they all must use the same SLP port,
> doesn't that mean there can be only one server per host? If so, how do I use
> the livetribe slp library to make this work?

You may want to wait a few days for SLP 2.0 to be released, which has
a much more polished API and supports the multiple SA per host
configuration as well as one SA per host.

As for your question, the scenario (valid for 1.x and 2.x) is a
network with no DA, and multiple SA per host.
Each JVM exposes one (or more, although there is no practical reason
to have more than 1 SA per JVM) SA and each SA can register and thus
expose any number of services.
This is done avoiding that a SA listens on the SLP tcp port, but
instead having it only listen on the SLP multicast port, since it is
possible to have many multicast socket bound to the same address/port.
Of course in this case usage of multicast is heavier, but allows to
forget about setting up an external server (the single SA server).

For an example, you can refer to:
http://svn.codehaus.org/livetribe/garden/livetribe-slp/trunk/src/test/java/org/livetribe/slp/ServiceAgentClusterTest.java

or briefly:

StandardServiceAgent sa1 = new StandardServiceAgent();
sa1.start();
StandardServiceAgent sa2 = new StandardServiceAgent();
sa2.start();
sa1.register(service1);
sa2.register(service2);

Again, I'll recommend to wait for 2.0, since the API is much more
usable and clear.

Simon
--
http://bordet.blogspot.com

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


 « Return to Thread: multiple jvms on one host using slp server