示例#1
0
        private void OpenSession()
        {
            if (SupportsFeature(XmppStreamFeatures.Sessions))
            {
                var iq = new IQ();

                iq.Type = IQType.Set;
                iq.To   = connectionString.HostName;
                iq.ID   = XmppIdentifierGenerator.Generate();

                iq.Items.Add(new Session());

                Send(iq);
            }
        }
示例#2
0
        private void BindResource()
        {
            if (SupportsFeature(XmppStreamFeatures.ResourceBinding))
            {
                var bind = new Bind();
                bind.Resource = UserId.ResourceName;

                var iq = new IQ();
                iq.Type = IQType.Set;
                iq.ID   = XmppIdentifierGenerator.Generate();

                iq.Items.Add(bind);

                Send(iq);

                bindResourceEvent.WaitOne();
            }
        }