Not logged in. · Lost password · Register
Forum: agsXMPP RSS
connection port 443 when not available 5222
Avatar
alomejo2 #1
Member since Dec 2006 · 4 posts
Group memberships: Members
Show profile · Link to this post
Subject: connection port 443
Hello:

In my local network, the connections by port 5222 and 5223 are cut, reason why it is only possible to be connected through ports 80 and 443. The Google Talk yes that it is connected well, nevertheless with AGSXMPP is not connected, because it is connected by the 5222. I have tried to make:
XmppCon.Port = Integer.Parse(443)

But it continues using port 5222.
You know some solution?

Thank you very much.
Avatar
Jabberer #2
Member since Feb 2006 · 249 posts
Group memberships: Members
Show profile · Link to this post
if you use:
  1. AutoResolveConnectServer = true;
then agsXMPP resolves the host and port from the SRV-Records in DNS.
So set this to false if you want to set a port manual.
Software Developer
AG-Software
Avatar
alomejo2 #3
Member since Dec 2006 · 4 posts
Group memberships: Members
Show profile · Link to this post
I use that instruction, but it follows without connecting.
With the application of example I have seen that an error exists: Exception of the type ' System.Net.Sockets.SocketException' in System.dll

In my application it does not give any exception, but it does not connect and it does not generate any event (onError).

This is my code:
        XmppCon = New XmppClientConnection
        jid = New Jid("xxxxxxxx@gmail.com")
        XmppCon.Server = jid.Server
        XmppCon.Username = jid.User
        XmppCon.Password = "xxxxxxxxxxxxxx"
        XmppCon.Resource = "MiniClient"
        XmppCon.Priority = 10
        XmppCon.Port = Integer.Parse(5223)
        XmppCon.UseSSL = True
        XmppCon.ConnectServer = Nothing
        XmppCon.AutoResolveConnectServer = True
        XmppCon.SocketConnectionType = agsXMPP.net.SocketConnectionType.Direct
        XmppCon.UseStartTLS = True
        XmppCon.Open()
Avatar
alomejo2 #4
Member since Dec 2006 · 4 posts
Group memberships: Members
Show profile · Link to this post
With this code it does not connect either:

        XmppCon = New XmppClientConnection
        jid = New Jid("xxxxxxxx@gmail.com")
        XmppCon.Server = jid.Server
        XmppCon.Username = jid.User
        XmppCon.Password = "xxxxxxxxxxxxxx"
        XmppCon.Resource = "MiniClient"
        XmppCon.Priority = 10
        XmppCon.Port = Integer.Parse(443)
        XmppCon.UseSSL = True
        XmppCon.ConnectServer = Nothing
        XmppCon.AutoResolveConnectServer = False
        XmppCon.SocketConnectionType = agsXMPP.net.SocketConnectionType.Direct
        XmppCon.UseStartTLS = True
        XmppCon.Open()
Avatar
Jabberer #5
Member since Feb 2006 · 249 posts
Group memberships: Members
Show profile · Link to this post
you have to specify the ConnectServer.

use:
  1. _connection.ConnectServer = "talk.google.com";

currently i can't connect to port 443, but i had success on port 80.
If i remember correctly it was working on port 443 before.
So try port 80.
Software Developer
AG-Software
Avatar
alomejo2 #6
Member since Dec 2006 · 4 posts
Group memberships: Members
Show profile · Link to this post
You are the best ones.
Thank you very much by the solution.

The program is connected through port 80
Avatar
rbpkirow #7
Member since Feb 2009 · 2 posts
Group memberships: Members
Show profile · Link to this post
Subject: my app doesn't connect
Hello.
I'm trying to make an app that connect with gtalk.
My code is:

            XmppClientConnection xmpp = new XmppClientConnection();
            Jid jid = new Jid("myUser@gmail.com");
            xmpp.Server = jid.Server;
            xmpp.Username = jid.User;
            xmpp.Password = "******";
            xmpp.Resource = "MiniClient";
            xmpp.Priority = 10;
            xmpp.Port = int.Parse("80");
            xmpp.UseSSL = true;
            xmpp.ConnectServer = "talk.google.com";
           
            xmpp.AutoResolveConnectServer = false;
            xmpp.SocketConnectionType = agsXMPP.net.SocketConnectionType.Direct;
            xmpp.UseStartTLS = true;
            xmpp.Open();

            xmpp.OnLogin += new ObjectHandler(xmpp_OnLogin);
            xmpp.OnWriteXml += new XmlHandler(xmpp_OnWriteXml);
            xmpp.OnWriteSocketData += new agsXMPP.net.BaseSocket.OnSocketDataHandler(xmpp_OnWriteSocketData);

First, the app launchs the OnWriteXml event with:
<stream:stream to='gmail.com' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' xml:lang='en'>


Then, it launchs the xmpp_OnWriteSocketData event but it doesn't receive anything.

Could you help me? Does anybody know what I doing wrong?
thanks a lot
rbpkirow
Avatar
Alex #8
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
you port is wrong. XMPP is using 5222 by default.
Don't use the ConnectServer and Port properties. Set AutoResolveConnectServer to true and agsXMPP will discover the server and port automatically from the DNS.

Please also look at the Gtalk example.

Alex
Avatar
rbpkirow #9
Member since Feb 2009 · 2 posts
Group memberships: Members
Show profile · Link to this post
Subject: solved
Thanks a lot, Alex.
Now it works fine.
regards
rbpkirow
Avatar
Alex #10
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Google Talk allows also connections on port 443 to bypass some firewalls:
http://www.google.com/support/talk/bin/answe…?hl=en&…

with the following settings you can also connect with agsXMPP on port 443 to GTalk.

  1. xmppCon.Username = jidUser.User;
  2. xmppCon.Server = jidUser.Server;
  3. xmppCon.Password = txtPassword.Text;
  4.  
  5. xmppCon.AutoResolveConnectServer =false;
  6. xmppCon.Port = 443;
  7. xmppCon.ConnectServer = "talk.google.com";
  8. xmppCon.UseStartTLS = false;
  9. xmppCon.UseSSL = true;
  10.  
  11. xmppCon.Open();

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