Esempio n. 1
0
        public void Start()
        {
            CheckDisposed();
            if (listening)
            {
                return;
            }

            EndPointManager.AddListener(_logger, this);
            listening = true;
        }
        public void Add(string uriPrefix)
        {
            listener.CheckDisposed();
            ListenerPrefix.CheckUri(uriPrefix);
            if (prefixes.Contains(uriPrefix))
            {
                return;
            }

            prefixes.Add(uriPrefix);
            if (listener.IsListening)
            {
                EndPointManager.AddPrefix(_logger, uriPrefix, listener);
            }
        }
        public bool Remove(string uriPrefix)
        {
            listener.CheckDisposed();
            if (uriPrefix == null)
            {
                throw new ArgumentNullException("uriPrefix");
            }

            bool result = prefixes.Remove(uriPrefix);

            if (result && listener.IsListening)
            {
                EndPointManager.RemovePrefix(_logger, uriPrefix, listener);
            }

            return(result);
        }
Esempio n. 4
0
        void CheckIfRemove()
        {
            if (prefixes.Count > 0)
            {
                return;
            }

            List <ListenerPrefix> list = unhandled;

            if (list != null && list.Count > 0)
            {
                return;
            }

            list = all;
            if (list != null && list.Count > 0)
            {
                return;
            }

            EndPointManager.RemoveEndPoint(this, endpoint);
        }
Esempio n. 5
0
 void Close(bool force)
 {
     CheckDisposed();
     EndPointManager.RemoveListener(_logger, this);
     Cleanup(force);
 }