使用 agsxmpp 庫建立 Xmpp 客戶端連線

public void OpenXmppConnection(int port, bool useSsl, string serverJid, string userName, string password)
        {
            try
            {
                _xmppClientConnection.AutoResolveConnectServer = true;
                _xmppClientConnection.Port = port;
                _xmppClientConnection.UseSSL = useSsl;
                _xmppClientConnection.Server = serverJid;
                _xmppClientConnection.Username = userName;
                _xmppClientConnection.Password = password;
                _xmppClientConnection.Resource = "web";

                //authenticate and open connection with server
                _xmppClientConnection.Open();
            }
            catch (Exception ex)
            {
            }
        }