Not logged in. · Lost password · Register
Forum: MatriX and XmppDotNet RSS
Avatar
tsfaridi #1
User title: Taha Saghir
Member since Mar 2011 · 15 posts · Location: Quetta, Pakistan
Group memberships: Members
Show profile · Link to this post
Subject: No Connection could be made because the target machine actively refused it...
Hey!

I am integrating to facebook chat, using Matrix XMPP. I am using X-FACEBOOK-PLATFORM SASL authentication mechanism. I have taken xmpp_login extended permission and policy server is also running (included with SDK). I am using following code:

            XmppClient xmppClient = new XmppClient();

            xmppClient.OnBeforeSasl += xmppClient_OnBeforeSasl;
            xmppClient.OnError += xmppClient_OnError;           

            xmppClient.Show = Matrix.Xmpp.Show.chat;           
            xmppClient.Hostname = "chat.facebook.com";           
            xmppClient.ProxyType = Matrix.Net.Proxy.ProxyType.HttpTunnel;
            xmppClient.ProxyHostname = "localhost";
            xmppClient.ProxyPort = 4503;           

            xmppClient.Open();
      
        void xmppClient_OnLogin(object sender, Matrix.EventArgs e)
        {
            gui.Dispatcher.BeginInvoke(() => MessageBox.Show("login"));
        }

        private void xmppClient_OnError(object sender, Matrix.ExceptionEventArgs e)
        {           
            gui.Dispatcher.BeginInvoke(() => MessageBox.Show(e.Exception.Message));           
        }

        private void xmppClient_OnBeforeSasl(object sender, Matrix.Xmpp.Sasl.SaslEventArgs e)
        {           
            e.Auto = false;
            e.SaslMechanism = Matrix.Xmpp.Sasl.SaslMechanism.X_FACEBOOK_PLATFORM;

            e.SaslProperties = new Matrix.Xmpp.Sasl.Processor.Facebook.FacebookProperties
            {
                ApiKey = applicationKey,
                ApiSecret = applicationSecret,
                SessionKey = browserSession.SessionKey
            };           
        }

I got following error:
No Connection could be made because the target machine actively refused it.


Regards,
Taha!
Avatar
Alex #2
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
have you tried the IP address of your proxy server instead of the hostname? This can be a ipv4 ipv6 issue. Which proxy server software are you using?

Alex
Avatar
tsfaridi #3
User title: Taha Saghir
Member since Mar 2011 · 15 posts · Location: Quetta, Pakistan
Group memberships: Members
Show profile · Link to this post
I am not using any proxy server software. I am running the policy server provided with SDK.
Avatar
Alex #4
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
In reply to post #1
Quote by tsfaridi:
xmppClient.ProxyType = Matrix.Net.Proxy.ProxyType.HttpTunnel;
xmppClient.ProxyHostname = "localhost";
xmppClient.ProxyPort = 4503;

you have configured MatriX to connect over a HTTP Proxy server on port 4503. When you have no HTTP proxy running on this port then it of course can not work.

Alex
Avatar
tsfaridi #5
User title: Taha Saghir
Member since Mar 2011 · 15 posts · Location: Quetta, Pakistan
Group memberships: Members
Show profile · Link to this post
I am just confused, then what is the use of policy server?
Avatar
Alex #6
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Silverlight requests and processes a policy file from a socket policy server before it can open a socket cnonection
You can find more info here:
http://msdn.microsoft.com/en-us/library/cc645032(VS.95).aspx

Alex
Avatar
Alex #7
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
send me an email then I can send you the proxy server which we use for our tests.

Alex
Avatar
tsfaridi #8
User title: Taha Saghir
Member since Mar 2011 · 15 posts · Location: Quetta, Pakistan
Group memberships: Members
Show profile · Link to this post
In reply to post #1
Thank you so much Alex!

After running the proxy server the error no longer persists, but upon calling
xmppClient.Open
it seems to be idle and do not login to facebook chat. I have also tried sample client provided with SDK, it is also not working. The code segment used is same as previous...

Quote by tsfaridi on 2011-04-12, 20:13:
1302632030


Regards,
Taha!
Avatar
Alex #9
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Please post your Xml log when there is any. And make sure that you use the latest version 1.4.0.1 for X_FACEBOOK_PLATFORM SASL authentication.

Alex
Avatar
tsfaridi #10
User title: Taha Saghir
Member since Mar 2011 · 15 posts · Location: Quetta, Pakistan
Group memberships: Members
Show profile · Link to this post
There is no log generated. Yes, I am using the right version.
Avatar
tsfaridi #11
User title: Taha Saghir
Member since Mar 2011 · 15 posts · Location: Quetta, Pakistan
Group memberships: Members
Show profile · Link to this post
Thank you Alex! Problem has been resolved, I was missing
xmppClient.XmppDomain = "chat.facebook.com";


Regards,
Taha!
Avatar
Alex #12
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
In reply to post #10
great to hear ;-)
When you run an out of the browser app in Silverlight 4 in elevated permission mode then you don't have to bother with this policy stuff. When your app will be in the browser then you have to because of the Silverlight policy model.
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: