In addition to standard publish-subscribe with RTserver and RTclient, SmartSockets provides a multicast option to further enhance the features and performance of SmartSockets. This option uses reliable multicast, taking full advantage of its bandwidth optimization properties. Multicast is an efficient way of routing a message to multiple recipients. The SmartSockets Multicast option enables messages to be multicast to RTclients. The SmartSockets Multicast option uses the PGM protocol to route messages and a new RT process called RTgms to handle the message routing. There are special PGM options for RTclients, and an extended logical connection name that allows the RTclient to connect to the RTgms process. To enable an RTclient to receive or send multicast messages, the RTclient simply connects to the RTgms process, instead of connecting to an RTserver.
To use multicast with SmartSockets, you must have a SmartSockets Multicast license, separate from your standard SmartSockets license. The SmartSockets Multicast option is available on UNIX and Windows platforms. Contact your TIBCO sales representative for more information. Any RTservers that RTgms connects to must be at the same SmartSockets version level as the RTgms process. Any RTclients receiving multicast must be running with the SmartSockets Version 6.0 or higher runtime libraries. To use the multicast protocol, PGM, your network hardware, such as routers and switches, must configured for multicast use.
For more information on multicasting or working with RTgms, see the TIBCO SmartSockets User’s Guide. The rest of this section covers Java-related information only.
To use multicast with Java, there are several things you must do:
mcast.cm
and mcastopts.cm
, for your RTclients that want to use multicast.
The mcast.cm
command file uses special PGM options to control the PGM aspects of multicast, and these options are the same in both C and Java. These options must be set in the mcast.cm
file.
The mcastopts.cm
command file contains one option, mcast_cm_file, which you can use to specify the location of your mcast.cm
file if you do not want to use the default location or you want to share a single mcast.cm
file across multiple systems. The value you specify should be a fully qualified pathname.
For information on the multicast command files and setting the PGM options, see the chapter on multicast in the TIBCO SmartSockets User’s Guide.
ss-pgm.jar
to your CLASSPATH
environment variable. See your operating system documentation for instructions to add a file name to the CLASSPATH
.If the SmartSockets system is enabled for multicast and the RTclient wants to use multicast, the RTclient must connect to an RTgms for its global connection instead of connecting to an RTserver. In most cases, the only change required is to the ss.group_names and ss.server_names options for the RTclient. The RTclient still uses the TipcSvc.getSrv method to make the connection. For information on RTclient options and how to set them, see Chapter 9, RTclient Options.
The ss.group_names option specifies which multicast group the RTclient belongs to. The default is rtworks
, and you only need to change the value if you are not using that group name.
The ss.server_names option must provide the logical connection name for an RTgms process instead of the logical connection name for an RTserver process.
For example, the property database for your RTclient might contain:
Let us assume the RTclient should belong to the multicast group mcast1
, and should connect to the RTgms on nodea
using the default port, which is 5104. Change the lines to:
If you want to connect to an RTgms that is not using the default port, change the ss.server_names line to:
which connects to the RTgms on nodea
using the TCP protocol on port 6000. For more information on the format of RTgms addresses, see Logical Connection Names for Multicast.
Use TipcSvc.getSrv to connect to the RTgms process the same way you connect to an RTserver process:
TipcSrv srv=TipcSvc.getSrv(); if (!srv.create()) { Tut.exitFailure("Couldn't connect to RTgms!\n"); }
To also connect to RTservers, the RTclient can use the multiple connections feature, and create those RTserver connections using the TipcSvc.createSrv method.
There are two parts of the logical connection name that differ for multicast. Generally, the logical connection name is:
When specifying a multicast logical connection name to connect to RTgms, the value for protocol is always pgm
. The address portion of your logical connection name is a different format than for other protocols.
The format for multicast is:
where:
If you specify a multicast format address, and your SmartSockets system does not have the multicast option installed, you receive an error when you attempt to connect to RTgms.
TIBCO SmartSockets™ Java Library User’s Guide and Tutorial Software Release 6.8, July 2006 Copyright © TIBCO Software Inc. All rights reserved www.tibco.com |