使用 agsxmpp 庫關閉 XMPP 連線

  public class ConnectionManager
    { 
         private XmppClientConnection _xmppClientConnection = null;

         public ConnectionManager()
                {
                    if (_xmppClientConnection == null)
                    {
                        _xmppClientConnection = new XmppClientConnection();
                    }
                }
         public void CloseXmppConnection()
                {
                    try
                    {
                        if (_xmppClientConnection != null)
                        {
                                //Close xmpp Client Connection
                             _xmppClientConnection.Close();
                        }
                        
                      
                    }
                    catch (Exception ex)
                    {
                    }
                }
    }