예제 #1
0
 public override void WriteStartTag(Stream stream)
 {
     // We don't send the <stream:stream> tag in XEP 124.
     XEP124Socket mySock = ((XEP124Socket) Socket);
     mySock.NS = stream.NS;
     mySock.Write(null, 0, 0);
 }
예제 #2
0
        /// <summary>
        /// Got the stream:stream.  Start the handshake.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="tag"></param>
        protected override void OnDocumentStart(object sender, System.Xml.XmlElement tag)
        {
            base.OnDocumentStart(sender, tag);
            if (this.Type == ComponentType.Connect)
            {
                lock (StateLock)
                {
                    State = HandshakingState.Instance;
                }

                jabber.protocol.stream.Stream str = new jabber.protocol.stream.Stream(this.Document, NS);
                str.To        = this.ComponentID;
                this.StreamID = str.ID;
                if (ServerVersion.StartsWith("1."))
                {
                    str.Version = "1.0";
                }


                WriteStartTag(str);

                if (ServerVersion.StartsWith("1."))
                {
                    Features f = new Features(this.Document);
                    if (AutoStartTLS && !SSLon && (this[Options.LOCAL_CERTIFICATE] != null))
                    {
                        f.StartTLS = new StartTLS(this.Document);
                    }
                    Write(f);
                }
            }
        }
예제 #3
0
        public override void WriteStartTag(Stream stream)
        {
            // We don't send the <stream:stream> tag in XEP 124.
            XEP124Socket mySock = ((XEP124Socket) Socket);
            mySock.NS = stream.NS;

            bool first = !IsInitialized();
            if (!first) {
                mySock.RestartStream();
            }

            mySock.Write(null, 0, 0);
        }
예제 #4
0
        private bool FakeReceivedStream()
        {
            jabber.protocol.stream.Stream stream =
                new jabber.protocol.stream.Stream(m_doc, NS);
            stream.Version = "1.0";
            stream.ID      = m_authID;

            byte[] sbuf = ENC.GetBytes(stream.StartTag());
            if (!m_listener.OnRead(this, sbuf, 0, sbuf.Length))
            {
                Close();
                return(false);
            }
            return(true);
        }
예제 #5
0
        /// <summary>
        /// Got the stream:stream.  Start the handshake.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="tag"></param>
        protected override void OnDocumentStart(object sender, System.Xml.XmlElement tag)
        {
            base.OnDocumentStart(sender, tag);
            if (this.Type == ComponentType.Connect)
            {
                lock (StateLock)
                {
                    State = HandshakingState.Instance;
                }

                jabber.protocol.stream.Stream str = new jabber.protocol.stream.Stream(this.Document, NS);
                str.To = this.ComponentID;
                this.StreamID = str.ID;
                if (ServerVersion.StartsWith("1."))
                    str.Version = "1.0";


                WriteStartTag(str);

                if (ServerVersion.StartsWith("1."))
                {
                    Features f = new Features(this.Document);
                    if (AutoStartTLS && !SSLon && (this[Options.LOCAL_CERTIFICATE] != null))
                        f.StartTLS = new StartTLS(this.Document);
                    Write(f);
                }
            }
        }
예제 #6
0
 /// <summary>
 /// Sends a new XMPP stream header.
 /// </summary>
 protected void SendNewStreamHeader()
 {
     jabber.protocol.stream.Stream str = new jabber.protocol.stream.Stream(m_doc, NS);
     str.To = new JID((string)this[Options.TO]);
     str.Version = "1.0";
     m_stanzas.WriteStartTag(str);
     InitializeStream();
 }
예제 #7
0
        private bool FakeReceivedStream()
        {
            jabber.protocol.stream.Stream stream =
                new jabber.protocol.stream.Stream(m_doc, NS);
            stream.Version = "1.0";
            stream.ID = m_authID;

            byte[] sbuf = ENC.GetBytes(stream.StartTag());
            if (!m_listener.OnRead(this, sbuf, 0, sbuf.Length))
            {
                Close();
                return false;
            }
            return true;
        }