예제 #1
0
        /// <summary>
        /// Add a StreamHost
        /// </summary>
        /// <param name="jid"></param>
        /// <param name="host"></param>
        /// <param name="port"></param>
        /// <param name="zeroconf"></param>
        /// <returns></returns>
        public StreamHost AddStreamHost(Jid jid, string host, int port, string zeroconf)
        {
            StreamHost sh = new StreamHost(jid, host, port, zeroconf);

            AddChild(sh);
            return(sh);
        }
예제 #2
0
        /// <summary>
        ///     Add a StreamHost
        /// </summary>
        /// <param name="jid"></param>
        /// <param name="host"></param>
        /// <param name="port"></param>
        /// <returns></returns>
        public StreamHost AddStreamHost(Jid jid, string host, int port)
        {
            var sh = new StreamHost(jid, host, port);

            AddChild(sh);
            return(sh);
        }
예제 #3
0
        /// <summary>
        /// Add a StreamHost
        /// </summary>
        /// <param name="jid"></param>
        /// <param name="host"></param>
        /// <returns></returns>
        public StreamHost AddStreamHost(Jid jid, string host)
        {
            StreamHost sh = new StreamHost(jid, host);

            AddChild(sh);
            return(sh);
        }
예제 #4
0
        /// <summary>
        /// Add a StreamHost
        /// </summary>
        /// <returns></returns>
        public StreamHost AddStreamHost()
        {
            StreamHost sh = new StreamHost();

            AddChild(sh);
            return(sh);
        }
예제 #5
0
        /// <summary>
        ///     Get the list of streamhosts
        /// </summary>
        /// <returns></returns>
        public StreamHost[] GetStreamHosts()
        {
            var nl    = SelectElements(typeof(StreamHost));
            var hosts = new StreamHost[nl.Count];
            var i     = 0;

            foreach (Element e in nl)
            {
                hosts[i] = (StreamHost)e;
                i++;
            }
            return(hosts);
        }
예제 #6
0
        /// <summary>
        /// Get the list of streamhosts
        /// </summary>
        /// <returns></returns>
        public StreamHost[] GetStreamHosts()
        {
            ElementList nl = SelectElements(typeof(StreamHost));

            StreamHost[] hosts = new StreamHost[nl.Count];
            int          i     = 0;

            foreach (Element e in nl)
            {
                hosts[i] = (StreamHost)e;
                i++;
            }
            return(hosts);
        }
예제 #7
0
        private void SendStreamHostUsedResponse(StreamHost sh, IQ iq)
        {
            ByteStreamIq bsIQ = new ByteStreamIq(IqType.result, Contact.FullJid);
            bsIQ.Id = iq.Id;

            bsIQ.Query.StreamHostUsed = new StreamHostUsed(sh.Jid);
            _xmppConnection.Send(bsIQ);
        }
예제 #8
0
        private void OnProxyDiscoResult(object sender, IQ iq, object data)
        {
            _streamHostProxy = null;

            if (iq.Error == null &&
                iq.Type == IqType.result)
            {
                ByteStream byteStream = iq.Query as ByteStream;

                if (byteStream != null
                    && byteStream.GetStreamHosts().Length > 0)
                {
                    _streamHostProxy = byteStream.GetStreamHosts()[0];
                }
            }

            SendStreamHosts();
        }
예제 #9
0
 /// <summary>
 /// Add a StreamHost
 /// </summary>
 /// <param name="sh"></param>
 /// <returns></returns>
 public StreamHost AddStreamHost(StreamHost sh)
 {
     AddChild(sh);
     return(sh);
 }
예제 #10
0
        private void SendStreamHostUsedResponse(StreamHost sh, IQ iq)
        {
            ByteStreamIq bsIQ = new ByteStreamIq(IqType.result, m_From);
            bsIQ.Id = iq.Id;

            bsIQ.Query.StreamHostUsed = new StreamHostUsed(sh.Jid);
            m_XmppCon.Send(bsIQ);
        }
예제 #11
0
파일: ByteStream.cs 프로젝트: don59/agsXmpp
 /// <summary>
 /// Add a StreamHost
 /// </summary>
 /// <returns></returns>
 public StreamHost AddStreamHost()
 {
     StreamHost sh = new StreamHost();
     AddChild(sh);
     return sh;
 }
예제 #12
0
파일: ByteStream.cs 프로젝트: don59/agsXmpp
 /// <summary>
 /// Get the list of streamhosts
 /// </summary>
 /// <returns></returns>
 public StreamHost[] GetStreamHosts()
 {
     ElementList nl = SelectElements(typeof(StreamHost));
     StreamHost[] hosts = new StreamHost[nl.Count];
     int i = 0;
     foreach (Element e in nl)
     {
         hosts[i] = (StreamHost) e;
         i++;
     }
     return hosts;
 }
예제 #13
0
파일: ByteStream.cs 프로젝트: don59/agsXmpp
 /// <summary>
 /// Add a StreamHost
 /// </summary>
 /// <param name="jid"></param>
 /// <param name="host"></param>
 /// <param name="port"></param>
 /// <param name="zeroconf"></param>
 /// <returns></returns>
 public StreamHost AddStreamHost(Jid jid, string host, int port, string zeroconf)
 {
     StreamHost sh = new StreamHost(jid, host, port, zeroconf);
     AddChild(sh);
     return sh;
 }
예제 #14
0
파일: ByteStream.cs 프로젝트: don59/agsXmpp
 /// <summary>
 /// Add a StreamHost
 /// </summary>
 /// <param name="jid"></param>
 /// <param name="host"></param>
 /// <returns></returns>
 public StreamHost AddStreamHost(Jid jid, string host)
 {
     StreamHost sh = new StreamHost(jid, host);
     AddChild(sh);
     return sh;
 }
예제 #15
0
파일: ByteStream.cs 프로젝트: don59/agsXmpp
 /// <summary>
 /// Add a StreamHost
 /// </summary>
 /// <param name="sh"></param>
 /// <returns></returns>
 public StreamHost AddStreamHost(StreamHost sh)
 {            
     AddChild(sh);
     return sh;
 }