Exemple #1
0
        /// <summary>
        ///   Procesa an arbitrary XMPP Message
        /// </summary>
        /// <param name = "node"></param>
        /// <returns></returns>
        private AutoResetEvent ProcessXmppMessage(XmppStreamElement node)
        {
            if (node != null)
            {
                Debug.WriteLine(node.ToString());

                if (node.OpensXmppStream)
                {
                    OnXmppStreamInitializedSubject.OnNext(node.ToString());
                }
                else if (node.ClosesXmppStream)
                {
                    OnXmppStreamClosedSubject.OnNext(node.ToString());
                }
                else
                {
                    var message = XmppSerializer.Deserialize(node.Name, node.ToString());

                    if (message != null)
                    {
                        if (message is Proceed)
                        {
                            return(tlsProceedEvent);
                        }

                        OnMessageReceivedSubject.OnNext(message);
                    }
                }
            }

            return(null);
        }
 private void ProcessResponse(HttpBindBody response)
 {
     foreach (var item in response.Items)
     {
         OnMessageReceivedSubject.OnNext(item);
     }
 }