/// <summary>
        /// Starts sending request to next hop in queue.
        /// </summary>
        /// <exception cref="InvalidOperationException">Is raised when no next hop available(m_pHops.Count == 0) and this method is accessed.</exception>
        private void SendToNextHop()
        {
            if (m_pHops.Count == 0)
            {
                throw new InvalidOperationException("No more hop(s).");
            }

            try{
                SIP_Hop hop = m_pHops.Dequeue();
                SendToFlow(m_pStack.TransportLayer.GetOrCreateFlow(hop.Transport, null, hop.EndPoint), m_pRequest.Copy());
            }
            catch (ObjectDisposedException x) {
                // Skip all exceptions if owner stack is disposed.
                if (m_pStack.State != SIP_StackState.Disposed)
                {
                    throw x;
                }
            }
        }
Пример #2
0
        /// <summary>
        /// Sends request to the specified hop.
        /// </summary>
        /// <param name="request">SIP request.</param>
        /// <param name="localEP">Local end point. Value null means system will allocate it.</param>
        /// <param name="hop">Target hop.</param>
        /// <exception cref="ObjectDisposedException">Is raised when this object is disposed and and this method is accessed.</exception>
        /// <exception cref="ArgumentNullException">Is raised when <b>request</b> or <b>hop</b> is null reference.</exception>
        public void SendRequest(SIP_Request request,IPEndPoint localEP,SIP_Hop hop)
        {
            if(m_IsDisposed){
                throw new ObjectDisposedException(this.GetType().Name);
            }
            if(request == null){
                throw new ArgumentNullException("request");
            }
            if(hop == null){
                throw new ArgumentNullException("hop");
            }

            SendRequest(GetOrCreateFlow(hop.Transport,localEP,hop.EndPoint),request);
        }