Пример #1
0
        //---------------------------------------------------------------------
        // Static members

        /// <summary>
        /// Reads the GeoTracker client settings from the application's configuration
        /// using the specified key prefix.
        /// </summary>
        /// <param name="keyPrefix">The application configuration key prefix.</param>
        /// <returns>The server settings.</returns>
        /// <remarks>
        /// <para>
        /// The GeoTracker client settings are loaded from the application
        /// configuration, using the specified key prefix.  The following
        /// settings are recognized by the class:
        /// </para>
        /// <div class="tablediv">
        /// <table class="dtTABLE" cellspacing="0" ID="Table1">
        /// <tr valign="top">
        /// <th width="1">Setting</th>
        /// <th width="1">Default</th>
        /// <th width="90%">Description</th>
        /// </tr>
        /// <tr valign="top">
        ///     <td>ServerEP</td>
        ///     <td><b>abstract://LillTek/GeoTracker/Server</b></td>
        ///     <td>
        ///     The external LillTek Messaging endpoint used by the client to
        ///     communicate with the GeoTracker cluster.
        ///     </td>
        /// </tr>
        /// </table>
        /// </div>
        /// </remarks>
        public static GeoTrackerClientSettings LoadConfig(string keyPrefix)
        {
            var config   = new Config(keyPrefix);
            var settings = new GeoTrackerClientSettings();

            settings.ServerEP = config.Get("ServerEP", settings.ServerEP);

            return(settings);
        }
Пример #2
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="router">The message router.</param>
        /// <param name="settings">The client side settings or <c>null</c> to use defaults.</param>
        public GeoTrackerClient(MsgRouter router, GeoTrackerClientSettings settings)
        {
            // Register the GeoTracker messages types with LillTek Messaging.

            LillTek.GeoTracker.Global.RegisterMsgTypes();

            // Other initialization

            if (settings == null)
            {
                settings = new GeoTrackerClientSettings();
            }

            this.router   = router;
            this.settings = settings;
            this.serverEP = new MsgEP(settings.ServerEP);
        }