OnLogin evnet not firing on agsXMPP

229 views Asked by At

I have an issue with agsXMPP onLogin event. when I was working on local machine everything worked just fine and when I established a connection with a server it seems that the onLogin() event is not fired up, although the connection state after I open() the connection is "Connected" this is how I establish the connection :

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

I tested the Openfire server with Spark IM, it seems that it works just fine so the problem is only in the configuration of my app any ideas on how to solve this problem please

1

There are 1 answers

0
Youssef R. On

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";