コード例 #1
0
        /// <summary>
        /// Return an LLSD-serializable Hashtable describing the
        /// capabilities and their handler details.
        /// </summary>
        /// <param name="excludeSeed">If true, then exclude the seed cap.</param>
        public Hashtable GetCapsDetails(bool excludeSeed)
        {
            Hashtable caps    = new Hashtable();
            string    baseUrl = m_httpListener.ServerURI;

            lock (m_capsHandlers)
            {
                foreach (string capsName in m_capsHandlers.Keys)
                {
                    if (excludeSeed && "SEED" == capsName)
                    {
                        continue;
                    }

                    CapsHandler handler = m_capsHandlers[capsName];
                    if (handler.HandlerIsExternal)
                    {
                        caps[capsName] = handler.ExternalHandlerURL;
                    }
                    else
                    {
                        IRequestHandler reqHandler = handler.RequestHandler;
                        caps[capsName] = baseUrl + reqHandler.Path;
                    }
                }
            }

            return(caps);
        }
コード例 #2
0
ファイル: Caps.cs プロジェクト: NoahStarfinder/My-Halcyon
        /// <summary>
        /// Registers an external handler that also can respond to pause and resume commands
        /// </summary>
        /// <param name="capsName"></param>
        /// <param name="url"></param>
        /// <param name="pauseTrafficHandler"></param>
        /// <param name="resumeTrafficHandler"></param>
        public void RegisterHandler(string capsName, string url, Action pauseTrafficHandler,
                                    Action resumeTrafficHandler, Action <int> setMaxBandwidthHandler)
        {
            var handler = new CapsHandler(capsName, url, true);

            handler.PauseTrafficHandler  = pauseTrafficHandler;
            handler.ResumeTrafficHandler = resumeTrafficHandler;
            handler.MaxBandwidthHandler  = setMaxBandwidthHandler;

            m_capsHandlers[capsName] = handler;
        }
コード例 #3
0
ファイル: Caps.cs プロジェクト: kf6kjg/halcyon
        /// <summary>
        /// Registers an external handler that also can respond to pause and resume commands
        /// </summary>
        /// <param name="capsName"></param>
        /// <param name="url"></param>
        /// <param name="pauseTrafficHandler"></param>
        /// <param name="resumeTrafficHandler"></param>
        public void RegisterHandler(string capsName, string url, Action pauseTrafficHandler, 
            Action resumeTrafficHandler, Action<int> setMaxBandwidthHandler)
        {
            var handler = new CapsHandler(capsName, url, true);
            handler.PauseTrafficHandler = pauseTrafficHandler;
            handler.ResumeTrafficHandler = resumeTrafficHandler;
            handler.MaxBandwidthHandler = setMaxBandwidthHandler;

            m_capsHandlers[capsName] = handler;
        }
コード例 #4
0
ファイル: Caps.cs プロジェクト: kf6kjg/halcyon
 /// <summary>
 /// Register an external handler. The service for this capability is somewhere else
 /// given by the URL.
 /// </summary>
 /// <param name="capsName"></param>
 /// <param name="url"></param>
 public void RegisterHandler(string capsName, string url)
 {
     m_capsHandlers[capsName] = new CapsHandler(capsName, url, false);
 }
コード例 #5
0
ファイル: Caps.cs プロジェクト: kf6kjg/halcyon
 /// <summary>
 /// Register a handler.  This allows modules to register handlers.
 /// </summary>
 /// <param name="capName"></param>
 /// <param name="handler"></param>
 public void RegisterHandler(string capName, IRequestHandler handler)
 {
     m_capsHandlers[capName] = new CapsHandler(capName, handler, false);
     //m_log.DebugFormat("[CAPS]: Registering handler for \"{0}\": path {1}", capName, handler.Path);
 }
コード例 #6
0
ファイル: Caps.cs プロジェクト: NoahStarfinder/My-Halcyon
 /// <summary>
 /// Register an external handler. The service for this capability is somewhere else
 /// given by the URL.
 /// </summary>
 /// <param name="capsName"></param>
 /// <param name="url"></param>
 public void RegisterHandler(string capsName, string url)
 {
     m_capsHandlers[capsName] = new CapsHandler(capsName, url, false);
 }
コード例 #7
0
ファイル: Caps.cs プロジェクト: NoahStarfinder/My-Halcyon
 /// <summary>
 /// Register a handler.  This allows modules to register handlers.
 /// </summary>
 /// <param name="capName"></param>
 /// <param name="handler"></param>
 public void RegisterHandler(string capName, IRequestHandler handler)
 {
     m_capsHandlers[capName] = new CapsHandler(capName, handler, false);
     //m_log.DebugFormat("[CAPS]: Registering handler for \"{0}\": path {1}", capName, handler.Path);
 }