Example #1
0
File: BoSH.cs Project: qq1257/Hello
        private void SendSessionTerminationRequest()
        {
            var body = new Body
            {
                SidAttr  = _sid,
                RidAttr  = Interlocked.Increment(ref _rid),
                TypeAttr = "terminate"
            };

            body.Add(new Presence {
                TypeAttr = Presence.TypeEnum.unavailable
            });

            SendRequest(body);
        }
Example #2
0
File: BoSH.cs Project: qq1257/Hello
        private void CombineBody(Body body)
        {
            lock (_fetchSync)
            {
                int counter = _manager.Settings.QueryCount;

                while (!_tagQueue.IsEmpty)
                {
                    XElement tag;
                    if (_tagQueue.TryDequeue(out tag))
                    {
                        body.Add(tag);
                        if (--counter == 0)
                        {
                            break;
                        }
                    }
                }
            }
        }