Exemple #1
0
        public XmppConnection AddXmppConnection(string server, string user, string pwd)
        {
            XmppConnection conn = new XmppConnection(server, user, pwd);

            m_connection.Add(conn);

            return(conn);
        }
        public XmppConnection AddXmppConnection(string server, string user, string pwd)
        {
            XmppConnection conn = new XmppConnection(server, user, pwd);

            m_connection.Add(conn);

            return conn;
        }
Exemple #3
0
        public XmppClient GetXmppClient(string server, string user, string pwd)
        {
            XmppConnection conn = _FindXmppConnection(server, user, pwd);

            if (conn == null)
            {
                conn = AddXmppConnection(server, user, pwd);
            }

            return(conn.Client);
        }
Exemple #4
0
        private XmppConnection _FindXmppConnection(string server, string user, string pwd)
        {
            IEnumerator <XmppConnection> it = m_connection.GetEnumerator();

            while (it.MoveNext())
            {
                XmppConnection conn = (XmppConnection)it.Current;
                if (conn.Server == server &&
                    conn.Username == user &&
                    conn.Password == pwd)
                {
                    return(conn);
                }
            }

            return(null);
        }