예제 #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
        /// <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
 /// <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
 /// <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);
 }