Exemplo n.º 1
0
        public XmppConnection AddXmppConnection(string server, string user, string pwd)
        {
            XmppConnection conn = new XmppConnection(server, user, pwd);

            m_connection.Add(conn);

            return(conn);
        }
Exemplo n.º 2
0
        public XmppConnection AddXmppConnection(string server, string user, string pwd)
        {
            XmppConnection conn = new XmppConnection(server, user, pwd);

            m_connection.Add(conn);

            return conn;
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }