示例#1
0
 /// <summary>
 /// Pending request can be removed.
 /// This is useful when a ressource for the callback is destroyed and
 /// we are not interested anymore at the result.
 /// </summary>
 /// <param name="id">ID of the Iq we are not interested anymore</param>
 public void Remove(Jid jid)
 {
     lock (m_grabbing)
     {
         if (m_grabbing.ContainsKey(jid.ToString()))
         {
             m_grabbing.Remove(jid.ToString());
         }
     }
 }
示例#2
0
        public void Add(Jid jid, IComparer comparer, MessageCB cb, object cbArg)
        {
            lock (m_grabbing)
            {
                if (m_grabbing.ContainsKey(jid.ToString()))
                {
                    return;
                }
            }

            TrackerData td = new TrackerData();

            td.cb       = cb;
            td.data     = cbArg;
            td.comparer = comparer;

            lock (m_grabbing)
            {
                m_grabbing.Add(jid.ToString(), td);
            }
        }
示例#3
0
        public void Add(Jid jid, PresenceCB cb, object cbArg)
        {
            lock (m_grabbing)
            {
                if (m_grabbing.ContainsKey(jid.ToString()))
                {
                    return;
                }
            }

            var td = new TrackerData();

            td.cb       = cb;
            td.data     = cbArg;
            td.comparer = new BareJidComparer();

            lock (m_grabbing)
            {
                m_grabbing.Add(jid.ToString(), td);
            }
        }
        private void SendOpenStream()
        {
            // <stream:stream
            // xmlns='jabber:component:accept'
            // xmlns:stream='http://etherx.jabber.org/streams'
            // to='shakespeare.lit'>
            StringBuilder sb = new StringBuilder();

            //sb.Append("<?xml version='1.0'?>");
            sb.Append("<stream:stream");

            if (m_ComponentJid != null)
            {
                sb.Append(" to='" + m_ComponentJid.ToString() + "'");
            }

            sb.Append(" xmlns='" + Uri.ACCEPT + "'");
            sb.Append(" xmlns:stream='" + Uri.STREAM + "'");

            sb.Append(">");

            Open(sb.ToString());
        }