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; }
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); }
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); }