Beispiel #1
0
        /// <summary>
        /// Add a RESTServer to the RESTCluster
        /// </summary>
        public void Add(string label, RESTServer server)
        {
            if (this._started)
            {
                server.Start();
            }

            this._servers.Add(label, server);
        }
Beispiel #2
0
        /// <summary>
        /// Add a RESTServer to the RESTCluster
        /// </summary>
        public void Add(string label, RESTServer server)
        {
            if (this._started)
            {
                server.Start();
            }

            this._servers.Add(label, server);
        }
    public void StartServer()
    {
        LOG.Write("Starting HTTP.");
        var server = new RESTServer();
        server.Start();

        while (server.IsListening)
        {
            System.Threading.Thread.Sleep(300);
        }
    }
        private DLLObjectWrapper()
        {
            restCommandLock = 0;
            mqlExperts = new Dictionary<Int64, MQLExpert>();
            mqlCommandManagers = new Dictionary<Int64, MQLCommandManager>();
            mqlThreadPools = new Dictionary<Int64, MQLThreadPool>();
            mqlExpertsLock = new object();
            restServer = new RESTServer();
            restServer.Start();

            // create the default command manager for REST
            // Only need to use chart specific one for ChartObjects
            mqlCommandManagers[DEFAULT_CHART_ID] = new MQLCommandManager(DEFAULT_CHART_ID);
        }
Beispiel #5
0
        /// <summary>
        /// Construction loads all routes found in the project's DLLs.
        /// </summary>
        internal RouteCache(RESTServer server, string baseUrl, bool autoLoadResources)
        {
            _routes = new List<Entry>();

            if (autoLoadResources)
            {
                foreach (RESTResource resource in LoadRestResources(baseUrl))
                {
                   resource.Server = server;
                   this.Add( resource );
                }

                SortRoutes();
            }
        }
Beispiel #6
0
 public void SetUp()
 {
     _host = new RESTServer( config );
       _host.AddResource( new TestResource() );
       _host.Start();
 }