我遇到agsXMPP onLogin事件的问题。 当我在本地机器上工作时,一切正常,当我与服务器建立连接时,似乎onLogin()事件没有被触发,虽然我打开()连接后的连接状态是"已连接& #34; 这就是我建立连接的方式:
Jid jid = new Jid(username, GlobalVar.server, "IM");
_connection.Server = GlobalVar.server;
_connection.Username = jid.User;
_connection.Password = psw;
_connection.Resource = jid.Resource;
_connection.Priority = 1;
_connection.Port = port;
_connection.UseSSL = useSLL;
_connection.AutoResolveConnectServer = true;
_connection.UseCompression = false;
_connection.EnableCapabilities = true;
_connection.Open();
SetDiscoInfo();
this.dadForm.DialogResult = DialogResult.OK;
MessageBox.Show(_connection.XmppConnectionState.ToString());
我使用Spark IM测试了Openfire服务器,似乎它运行得很好所以问题只出现在我的应用程序的配置中 关于如何解决这个问题的任何想法,请
答案 0 :(得分:1)
When you try to connect to an external server make sure that the property Server point on the server name and the ConnectServer on the IP address like this :
_connection.ConnectServer = "server IP adress";
_connection.Server = "server name";