Not logged in. · Lost password · Register
Forum: agsXMPP SDK Support RSS
Avatar
kianoosh #1
Member since Feb 2008 · 8 posts
Group memberships: Members
Show profile · Link to this post
Subject: Disconnected
The sample display this error when I'm trying to connect to the server:

RECV: <stream:error>Disconnected</stream:error></stream:stream>

I can connect to the server by Psi. I trace it step by step but nothing is wrong.

  1. Jid jid = new Jid(txtJid.Text, "127.0.0.1", "MiniClient");           
  2. _connection.Server                        = jid.Server;
  3. _connection.Username                    = jid.User;
  4. _connection.Password                    = "r1RQgnvNFYqgmehO2HwgPcF8lek977anOS/fARIcK+XATBltr658nOCwYfeOM0xyEeNar8yGhoWmx0B2lZOFAW35uEe34PFXMebqUnZuUvfbb5yDbGIGtV6UkYtkH84";
  5. _connection.Resource                    = txtResource.Text;
  6. _connection.Priority                    = (int) numPriority.Value;
  7. _connection.Port                        = int.Parse(txtPort.Text);
  8. _connection.UseSSL                        = chkSSL.Checked;
  9. _connection.AutoResolveConnectServer    = true;
  10. _connection.ConnectServer                = jid.Server;
  11. _connection.SocketConnectionType        = agsXMPP.net.SocketConnectionType.Direct;
  12. _connection.KeepAlive                   = true;
  13. _connection.UseCompression              = false;                       
  14. if (chkRegister.Checked)               
  15.     _connection.RegisterAccount         = true;           
  16. else
  17.     _connection.RegisterAccount         = false;
  18.  
  19.  
  20. // overwrite some settings for debugging
  21. _connection.UseStartTLS                 = false;
  22. _connection.UseSSL                      = false;
  23.  
  24. // overwrite some settings for Polling Test
  25. //_connection.SocketConnectionType          = agsXMPP.net.SocketConnectionType.HttpPolling;
  26. //_connection.UseCompression              = false;
  27. //_connection.UseStartTLS                  = false;
  28. //_connection.UseSSL                      = false;
  29. //_connection.AutoResolveConnectServer    = false;
  30. //_connection.ConnectServer               = "http://vm-2000:5280/http-poll";
  31.  
  32. this.DialogResult = DialogResult.OK;
  33.  
  34. SaveSettings();           
  35. this.Close();

Sincerely:

Kianoosh Akhavan Karbassi
Kianoosh Akhavan Karbassi
This post was edited 2 times, last on 2012-01-31, 20:53 by Alex.
Avatar
Alex #2
Member since Feb 2003 · 4245 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
why is your password that long?

never setup a xmpp server to a IP-Addresse, use a domain. Use the search function to find more info about this problem. There are many posts about that.
Alexander Gnauck
AG-Software
Avatar
kianoosh #3
Member since Feb 2008 · 8 posts
Group memberships: Members
Show profile · Link to this post
Thank you alex

                I did search about it in your forum but I still have the problem. Something that I forgot to tell you,it was that I can connect to the server if I choose "Redirect Unknown domain to local domain" and it use the default id to chat.
I know it is because of the username and password. I have changed the password to "test" and the username is "22222111@pishgaman.local" but I still can not connect to the server???!!!! I don't know why?

In redirect mode the stream is something like this

SEND: <stream:stream to='kianoosh-8decdf.pishgaman.local' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' xml:lang='en'>

RECV: <stream:stream xmlns='jabber:client' from='pishgaman.local' id='0247091455' xmlns:stream='http://etherx.jabber.org/streams' version='1.0'><stream:features><starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/></stream:features>

SEND: <iq xmlns="jabber:client" id="agsXMPP_2" type="get" to="kianoosh-8decdf.pishgaman.local"><query xmlns="jabber:iq:auth"><username>22222111\5c40pishgaman.local</username></query></iq>



Sincerely:

           Kianoosh Akhavan Karbassi
Kianoosh Akhavan Karbassi
This post was edited 2 times, last on 2008-02-14, 07:41 by kianoosh.
Avatar
Alex #4
Member since Feb 2003 · 4245 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
in XMPP you authenticate with SASL. Strong SASL mechanisms like DIGEST-MD5 use more than only username and password for your authentication. The XMPP domain is also part of the authentication. Which means it user@127.0.0.1, user@pishgaman.local or user@localhost have all different xmpp domains. Please look at your xmpp server configuration and use the xmpp domain its configured to.
Alexander Gnauck
AG-Software
Avatar
kianoosh #5
Member since Feb 2008 · 8 posts
Group memberships: Members
Show profile · Link to this post
Sorry Alex, but I don't get it, my mail server is 127.0.0.1 or "kianoosh-8decdf.pishgaman.local" and my domain name is pishgaman.local. Did you mean I should write for example 22222111@pishgaman.local? I did that but it doesn't work. I also tried 22222111@127.0.0.1 and 22222111@kianoosh-8decdf.pishgaman.local and again it doesn't work. And I can connect to the merak server(127.0.0.1) by 22222111@pishgaman.local and password test in Psi.

Sincerely

         Kianoosh Akhavan Karbassi
Kianoosh Akhavan Karbassi
Avatar
Alex #6
Member since Feb 2003 · 4245 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
sorry, but I'm not familiar with the merak xmpp server.

Can you please post your complete xml log which you get from the OnReadXml and OnWriteXml handlers?
Please post also the code you use for setting up your XmppCientConnection.

Thanks,
Alex
Alexander Gnauck
AG-Software
Avatar
kianoosh #7
Member since Feb 2008 · 8 posts
Group memberships: Members
Show profile · Link to this post
As you can see in my previous posts:

Write xml:
"<stream:stream to='127.0.0.1' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' xml:lang='en'>"

Read xml:
"<stream:error >"
RECV: <stream:error>Disconnected</stream:error></stream:stream>

private XmppClientConnection _connection;
private void cmdLogin_Click(object sender, System.EventArgs e)
{
           
            Jid jid = new Jid(txtJid.Text, "127.0.0.1", "pishgaman.local");                       
            _connection.Server                        = jid.Server;
            _connection.Username                    = jid.User;
            _connection.Password                    = txtPassword.Text;
            _connection.Resource                    = txtResource.Text;
            _connection.Priority                    = (int) numPriority.Value;
            _connection.Port                        = int.Parse(txtPort.Text);
            _connection.UseSSL                        = chkSSL.Checked;
            _connection.AutoResolveConnectServer    = false;
            _connection.ConnectServer                = jid.Server;
            _connection.SocketConnectionType        = agsXMPP.net.SocketConnectionType.Direct;
            _connection.KeepAlive                   = true;
            _connection.UseCompression              = false;        

            if (chkRegister.Checked)               
                _connection.RegisterAccount         = true;
            else
                _connection.RegisterAccount         = false;
           
            // overwrite some settings for debugging
            _connection.UseStartTLS                 = false;
            _connection.UseSSL                      = false;
           
            this.DialogResult = DialogResult.OK;
           
            SaveSettings();           
            this.Close();           
}

Sincerely:

            Kianoosh Akhavan Karbassi
Kianoosh Akhavan Karbassi
Avatar
kianoosh #8
Member since Feb 2008 · 8 posts
Group memberships: Members
Show profile · Link to this post
Dear Alex

       I really depend on your reply. I wonder why I can connect to the merak server by Psi but when I'm trying to connect to it by MiniCient! an error is occured
Do you have any idea or clue which can help me for this problem?!!!
How does MiniClient send the username and password to the mail server( messenger server) ? I mean which function or class do this job?
because it is something wrong with authentication. I can send my message by this code but not by this user by default user which the merak will convert if the username and password are wrong .

      try
            {
                XmppClientConnection xmpp = new XmppClientConnection("pishgaman.local", 5222);
                xmpp.Open("22222111@pishgaman.local/", "test");               
                xmpp.OnLogin += new ObjectHandler(XmppCon_OnLogin);
                //xmpp.OnLogin += delegate(object o) { xmpp.Send(new agsXMPP.protocol.client.Message("1234567897@pishgaman.local", MessageType.chat, "Hello, how are you?")); };                                                               
                xmpp.Send(new agsXMPP.protocol.client.Message("1234567897@pishgaman.local", MessageType.chat, "???? ????"));
                xmpp.OnError += new ErrorHandler(XmppCon_OnError);
                xmpp.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }


Best regards:

          Kianoosh Akhavan Karbassi
Kianoosh Akhavan Karbassi
Avatar
Alex #9
Member since Feb 2003 · 4245 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
In reply to post #7
Quote by kianoosh:
"<stream:stream to='127.0.0.1' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' xml:lang='en'>"
I said you should not use IP adresses for XMPP. You still use them.

Alex
Alexander Gnauck
AG-Software
Avatar
Alex #10
Member since Feb 2003 · 4245 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
In reply to post #8
Quote by kianoosh:
      try
            {
                XmppClientConnection xmpp = new XmppClientConnection("pishgaman.local", 5222);
                xmpp.Open("22222111@pishgaman.local/", "test");               
                xmpp.OnLogin += new ObjectHandler(XmppCon_OnLogin);
                //xmpp.OnLogin += delegate(object o) { xmpp.Send(new agsXMPP.protocol.client.Message("1234567897@pishgaman.local", MessageType.chat, "Hello, how are you?")); };                                                               
                xmpp.Send(new agsXMPP.protocol.client.Message("1234567897@pishgaman.local", MessageType.chat, "???? ????"));
                xmpp.OnError += new ErrorHandler(XmppCon_OnError);
                xmpp.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }



this code is totally wrong.
Please make a screenshot of your Psi account setup or provide us with the data you enter in Psi and I will let you know how to connect to your Merak server with agsXMPP.

Alex
Alexander Gnauck
AG-Software
Avatar
kianoosh #11
Member since Feb 2008 · 8 posts
Group memberships: Members
Show profile · Link to this post
I have sent you the images by email. sorry about that but I can't send it by your forum

Sincerely:

           Kianoosh Akhavan Karbassi
Kianoosh Akhavan Karbassi
The author has attached one file to this post:
1.JPG 30.1 kBytes
You have no permission to open this file.
This post was edited on 2008-02-17, 11:07 by Alex.
Avatar
Alex #12
Member since Feb 2003 · 4245 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
you can attach files. I edited your post for that.

So according to your screenshot your JabberId is 1234567897@pishgaman.local

your code from previous posts with some fixes is here:

  1. private void cmdLogin_Click(object sender, System.EventArgs e)
  2. {           
  3.     Jid jid = new Jid("1234567897@pishgaman.local");                       
  4.     _connection.Server                      = jid.Server;
  5.     _connection.Username                    = jid.User;
  6.     _connection.Password                    = txtPassword.Text;
  7.     _connection.Resource                    = txtResource.Text;
  8.     _connection.Priority                    = (int) numPriority.Value;
  9.     _connection.Port                        = int.Parse(txtPort.Text);
  10.     _connection.UseSSL                      = chkSSL.Checked;
  11.    
  12.     // you need the next 2 lines only if the domain or your JabberID (pishgaman.local) does not
  13.     // resolve to the server
  14.     _connection.AutoResolveConnectServer    = false;
  15.     _connection.ConnectServer               = "127.0.0.1"
  16.    
  17.     _connection.KeepAlive                   = true;
  18.     _connection.UseCompression              = false;       
  19.    
  20.     if (chkRegister.Checked)               
  21.         _connection.RegisterAccount         = true;
  22.     else
  23.         _connection.RegisterAccount         = false;
  24.    
  25.     // overwrite some settings for debugging
  26.     _connection.UseStartTLS                 = false;
  27.     _connection.UseSSL                      = false;
  28.    
  29.     this.DialogResult = DialogResult.OK;
  30.    
  31.     SaveSettings();           
  32.     this.Close();           
  33. }

let me know if this works. If not attach the Xml debug.

Alex
Alexander Gnauck
AG-Software
Avatar
kianoosh #13
Member since Feb 2008 · 8 posts
Group memberships: Members
Show profile · Link to this post
Thank you Alex. You are really wonderful. thank you thank you thank you

Sincerely:

             Kianoosh Akhavan Karbassi
Kianoosh Akhavan Karbassi
Avatar
kianoosh #14
Member since Feb 2008 · 8 posts
Group memberships: Members
Show profile · Link to this post
In reply to post #12
Thank you Alex. You are really wonderful. thank you thank you thank you. It works.

SEND: <stream:stream to='pishgaman.local' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' xml:lang='en'>

RECV: <stream:stream xmlns='jabber:client' from='pishgaman.local' id='0212141733' xmlns:stream='http://etherx.jabber.org/streams' version='1.0'><stream:features><starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/></stream:features>

SEND: <iq xmlns="jabber:client" id="agsXMPP_1" type="get" to="pishgaman.local"><query xmlns="jabber:iq:auth"><username>22222111</username></query></iq>

RECV: <iq id='agsXMPP_1' type='result'><query xmlns='jabber:iq:auth'><username>22222111</username><password/><resource/><digest/></query></iq>

SEND: <iq xmlns="jabber:client" id="agsXMPP_2" type="set"><query xmlns="jabber:iq:auth"><username>22222111</username><resource>kianoosh-8decdf.pishgaman.local</resource><digest>d3c0c66c08785e3dc0734cb2430a374e84f6fc32</digest></query></iq>

RECV: <iq id='agsXMPP_2' type='result'/>

SEND: <iq xmlns="jabber:client" id="agsXMPP_5" type="get" to="pishgaman.local"><query xmlns="http://jabber.org/protocol/disco#items" /></iq>

SEND: <iq xmlns="jabber:client" id="agsXMPP_3" type="get" to="pishgaman.local"><query xmlns="jabber:iq:agents" /></iq>

SEND: <iq xmlns="jabber:client" id="agsXMPP_4" type="get"><query xmlns="jabber:iq:roster" /></iq>

RECV:  <iq type='result' id='agsXMPP_3' from='pishgaman.local' to='22222111@pishgaman.local/kianoosh-8decdf.pishgaman.local'><query xmlns='jabber:iq:agents'><agent jid='Jabber'><name>Jabber</name><service>public</service><transport/></agent><agent jid='Jabber 2'><name>Jabber 2</name><service>public</service></agent><agent jid='Yahoo'><name>Yahoo</name><service>yahoo</service></agent></query></iq>

RECV:  <iq id='agsXMPP_4' type='result' from='22222111@pishgaman.local/kianoosh-8decdf.pishgaman.local'><query xmlns='jabber:iq:roster'><item jid='1234567897@pishgaman.local' subscription='none' ask='subscribe'></item><item jid='yahoo' subscription='none' ask='subscribe'></item></query></iq>

SEND: <presence xmlns="jabber:client"><status /><priority>1</priority></presence>

RECV:  <iq type='result' id='agsXMPP_8' from='Yahoo' to='22222111@pishgaman.local/kianoosh-8decdf.pishgaman.local'><query xmlns='http://jabber.org/protocol/disco#info'><identity category='gateway' type='aim' name='Yahoo Transport Gateway'/><feature var=

SEND: <iq xmlns="jabber:client" id="agsXMPP_6" type="get" to="Jabber"><query xmlns="http://jabber.org/protocol/disco#info" /></iq>

SEND: <iq xmlns="jabber:client" id="agsXMPP_7" type="get" to="Jabber 2"><query xmlns="http://jabber.org/protocol/disco#info" /></iq>

SEND: <iq xmlns="jabber:client" id="agsXMPP_8" type="get" to="Yahoo"><query xmlns="http://jabber.org/protocol/disco#info" /></iq>

RECV:  <iq type='result' id='agsXMPP_8' from='Yahoo' to='22222111@pishgaman.local/kianoosh-8decdf.pishgaman.local'><query xmlns='http://jabber.org/protocol/disco#info'><identity category='gateway' type='aim' name='Yahoo Transport Gateway'/><feature var='jabber:iq:register'/><feature var='jabber:iq:gateway'/><feature var='jabber:iq:time'/><feature var='jabber:iq:version'/></query></iq>


Sincerely:

             Kianoosh Akhavan Karbassi
Kianoosh Akhavan Karbassi
This post was edited on 2008-02-17, 12:06 by kianoosh.
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: agsXMPP SDK Support RSS