Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
mentor #1
Member since Mar 2007 · 6 posts
Group memberships: Members
Show profile · Link to this post
Subject: socket can't be connected
In order to test agsXMPP with wildfire, I set up a asp.net2.0 project, and copy the agsXMMPP files to \app_code subdirectory. Then I made a blank default.aspx page, in the default.aspx.cs  code is as in below,

protected void Page_Load(object sender, EventArgs e)
    {
        agsXMPP.XmppClientConnection jabberconn = new agsXMPP.XmppClientConnection("localhost");
        jabberconn.Open("admin", "a111111");
        do
        {
            Thread.Sleep(new System.TimeSpan((System.Int64)10000 * 5));
        } while (jabberconn.ConnectionState != agsXMPP.XmppConnectionState.Registered &&     (jabberconn.ConnectionState != agsXMPP.XmppConnectionState.Error));
       
    }

When debugging with some breakpoint, it came to Connect() method in clientsocket.cs.

  public override void Connect()
         {
    base.Connect();
    ....
            _socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
    _socket.BeginConnect(endPoint, new AsyncCallback(EndConnect), null);
    ...
    }
I found _socket is connected almost imediately after _socket.BeginConnect(), but after two or three more step run, the socket is disconnected automatically, and in EndConnect() method,  m_Stream = new NetworkStream(_socket, false); throw an exception, no stream can open. The defaul.aspx page then is always connecting, and can't be displayed.

I looked in to the log file of asp.net , and found an error,
System.Net.Sockets Error: 0 : [2144] Exception in the Socket#27621303::GetSocketOption - An unknown, invalid, or unsupported option or level was specified in a getsockopt or setsockopt call

I test the GAIM client and it can do be connected with the wildfire on the same machine.

Do you have any idea about the problem?
Avatar
Alex #2
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Hello,

no i have no idea.
Does the MiniClient example work for you?
Did you checkout the latest code from SVN?

Alex
Avatar
mentor #3
Member since Mar 2007 · 6 posts
Group memberships: Members
Show profile · Link to this post
Hi alex, thanks for your timely response.

I checked again, and found the reason for the socket error may be that step run debugging in VS2005 can't work for socket related program. The real error seems lie in authentication error, which is found when I test MiniClient.

I downloaded the latest version0.92 of agsXMPP from this site, and run the MiniCient with JabberID: admin@localhost, passwor: a111111 .  This account works well when using Gaim client and Wildfire server(version 3.1.0). But in MiniClient's Debug window, an authentication error is prompted: Wrong password or username. The entire Debug message is copied below. Would you kindly please have a look at it, and give me some advice how to adjust it?


SEND: <stream:stream to='localhost' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' xml:lang='en'>
RECV: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" from="d7eb8d4210174fd" version="1.0" xml:lang="en" id="12bfbd59" >
RECV: <stream:features xmlns:stream="http://etherx.jabber.org/streams"><starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls" /><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>PLAIN</mechanism><mechanism>CRAM-MD5</mechanism><mechanism>DIGEST-MD5</mechanism><mechanism>ANONYMOUS</mechanism></mechanisms><compression xmlns="http://jabber.org/features/compress"><method>zlib</method></compression><auth xmlns="http://jabber.org/features/iq-auth" /><register xmlns="http://jabber.org/features/iq-register" /></stream:features>
SEND: <compress xmlns="http://jabber.org/protocol/compress"><method>zlib</method></compress>
RECV: <compressed xmlns="http://jabber.org/protocol/compress" />
SEND: <stream:stream to='localhost' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' xml:lang='en'>
RECV: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" from="d7eb8d4210174fd" version="1.0" xml:lang="en" id="12bfbd59" >
RECV: <stream:features xmlns:stream="http://etherx.jabber.org/streams"><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>PLAIN</mechanism><mechanism>CRAM-MD5</mechanism><mechanism>DIGEST-MD5</mechanism><mechanism>ANONYMOUS</mechanism></mechanisms><auth xmlns="http://jabber.org/features/iq-auth" /><register xmlns="http://jabber.org/features/iq-register" /></stream:features>
SEND: <auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="DIGEST-MD5" />
RECV: <challenge xmlns="urn:ietf:params:xml:ns:xmpp-sasl">cmVhbG09ImQ3ZWI4ZDQyMTAxNzRmZCIsbm9uY2U9InBpaTlMc0JNRUh1VFhoUndoY2JzaUt6dTJ6MWMwNHM4N3JIOHRtdUgiLHFvcD0iYXV0aCIsY2hhcnNldD0idXRmLTgiLGFsZ29yaXRobT0ibWQ1LXNlc3Mi</challenge>
SEND: <response xmlns="urn:ietf:params:xml:ns:xmpp-sasl">dXNlcm5hbWU9ImFkbWluIixyZWFsbT0iZDdlYjhkNDIxMDE3NGZkIixub25jZT0icGlpOUxzQk1FSHVUWGhSd2hjYnNpS3p1MnoxYzA0czg3ckg4dG11SCIsY25vbmNlPSIwYjRmOTRlODcwY2I3MmVjNmMzMWMwZTQ1MDg2NTE2MjRmOTlkOGMxYjA2NzY3MThmZGY1YzkzNWU5NTk0ZGYyIixuYz0wMDAwMDAwMSxxb3A9YXV0aCxkaWdlc3QtdXJpPSJ4bXBwL2xvY2FsaG9zdCIsY2hhcnNldD11dGYtOCxyZXNwb25zZT1mNWZmZmRlMWVhYjU4Yjk2Y2RjNGU2M2QyNWRkMTYwMQ==</response>
RECV: <failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><not-authorized /></failure>
SEND: </stream:stream>
RECV: </stream:stream>


Avatar
Alex #4
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Hi mentor,

it's possible that Gaim does not use SASL authentication but the old jabber style authentication.
I assume that there is a problem with your server configuration. What is the XMPP domain in your wildfire server?
The domain is part of the SASL authentication and must match.

Alex
Avatar
mentor #5
Member since Mar 2007 · 6 posts
Group memberships: Members
Show profile · Link to this post
Alex, your are right. I replaced JID : admin@localhost with admin@81939b411fc8453, and then login succeeded. the string 81939b411fc8453 is given by Wildfire as xmpp.domain, also as servername. I'm still not clear where  it comes for Wildfire, but it does work. Thanks, Alex!
Avatar
Alex #6
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Hi mentor,

i think by default wildfire takes the machine name.
You can change the XMPP domain in the admin interface. If you change it make your that the XMPP Domain resolves in your DNS.

Alex
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 RSS