4.4.2 Using the host() Function: How “Host” and “Port” are Processed
Host and Port parameters both have global default values. Thus, if either an OmmConsumerConfig or OmmNiProviderConfig object exists, its Host and Port will always have values (either the default value or some other value as specified in a configuration XML file such as EmaConfig.xml).
• The default Host:Port value for OmmConsumerConfig is localhost:14002.
• The default Host:Port value for OmmNiProviderConfig is localhost:14003.
If needed, you can have the application reset both host and port values by calling the host( const EmaString& ) method on the object using the syntax: HostValue:PortValue.
NOTE: Calling the host() function sets channelType (refer to Section 3.4.2) to RSSL_SOCKET, regardless of how it was previously configured.
Host and Port values observe the following rules when updating due to the host( const EmaString& ) method:
• If the host parameter is missing or empty, then host and port reset to their global default values.
• If the host parameter is set to the string “:”, then host and port reset to their global default values.
• If the host parameter is a string (not containing a :), then host is set to that string and port resets to its default value.
• If the parameter begins with a : and is followed by some text, then host is set to its global default value and port is set to that text.
• If the parameter is HostValue:PortValue, where both HostValue and PortValue have values, then host is set to HostValue and port is set to PortValue.