You can configure TIBCO SmartSockets .NET in one of three ways:
In all cases, use the Tut.loadOptions()
method to load the configuration file or files.
![]() |
The naming standards for SmartSockets configuration options are consistent with those for SmartSockets java properties.
|
The following table provides a quick reference for configuring SmartSockets .NET.
If you are using the .NET Framework version 1.1 or later, you can configure SmartSockets options within the app.config
file using the <appSettings>
element with the <add>
parameter. Here is an example:
<?xml version="1.0" encoding="utf-8"?> <configuration> <appSettings> <add key="ss.server_names" value="tcp:_node:5555" /> <add key="ss.unique_subject" value="/CSharpTest" /> <add key="ss.monitor_ident" value="CSharp Client" /> </appSettings> </configuration>
Use Tut.loadOptions()
without parameters to load SmartSockets options from App.config
.
You can configure SmartSockets options within an external XML file using the <SmartSockets>
element with the <option name> node. Use standard key, value attributes with the <option name> element. Use Tut.loadOptions(<
string
>)
, passing either a URL or a directory path to load the configuration file.
In this example, a URL identifies the location of the configuration file.
In this example, a directory path identifies the location of the configuration file.
Below is an example configuration file.
<?xml version = "1.0" encoding = "UTF-8"?> <AnyRootNode> <SmartSockets> <option name = "ss.server_names" value = "tcp:_node:5555"/> <option name = "ss.unique_subject" value = "/xml_test_client"/> <option name = "ss.monitor_scope" value = "/..."/> </SmartSockets> </AnyRootNode>
You can place the SmartSockets element at any level except at the root. If multiple SmartSockets elements are found, they are parsed in the order found, overriding previous options. Tut.loadOptions()
will ignore any other elements, allowing for an easy addition of SmartSockets configuration attributes into existing XML files.
The options in App.config can act as a default configuration. You can then override individual options using an external configuration file. The last options loaded override any previously read options. Here is an example:
The first call to Tut.loadOptions()
loads the configuration options from App.config
. The second call loads the options from config.xml
, overriding any options that were set inside App.config
and exist in config.xml
. Options that are set in App.config
, but not in config.xml
still retain their values.
TIBCO SmartSockets™ .NET User’s Guide and Tutorial Software Release 6.8, July 2006 Copyright © TIBCO Software Inc. All rights reserved www.tibco.com |