Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
lijumathewv #1
Member since Sep 2013 · 2 posts
Group memberships: Members
Show profile · Link to this post
Subject: agsXMPP Development
Hi Alex,

I'm new to this development. Company has asked me to develop a Unified Communication Platform using OpenFire server instead of Lync 2013 which I preferred.

I have setup openfire in my machine and the server has started successfully. Everything is set in terms of OpenFire. I've tried to connect to openfire using Spark client and it is successfull.

Now I'm try to connect to openfire using my Windows Application. Following is my code.


  1. public Form1()
  2. {
  3.     InitializeComponent();
  4. }
  5.  
  6. agsXMPP.XmppClientConnection xcc;
  7.  
  8. private void button1_Click(object sender, EventArgs e)
  9. {
  10.     xcc = new agsXMPP.XmppClientConnection();
  11.     xcc.Resource = "agsXMPP";
  12.     xcc.Server = "liju-pc";
  13.     xcc.Username = "admin@liju-pc.com";
  14.     xcc.Password = textBox1.Text;
  15.     xcc.Port = 5222;
  16.     xcc.UseSSL = false;
  17.     xcc.UseStartTLS = false;
  18.     xcc.AutoResolveConnectServer = false;
  19.     xcc.UseCompression = false;
  20.     xcc.RegisterAccount = false;
  21.     xcc.SocketConnectionType = SocketConnectionType.Bosh;
  22.  
  23.     xcc.OnLogin += xcc_OnLogin;
  24.     xcc.OnSocketError += xcc_OnSocketError;
  25.     xcc.OnXmppConnectionStateChanged += xcc_OnXmppConnectionStateChanged;
  26.     xcc.OnError += xcc_OnError;
  27.    
  28.     xcc.Open();
  29. }
  30.  
  31. void xcc_OnError(object sender, Exception ex)
  32. {
  33.     throw new NotImplementedException();
  34. }
  35.  
  36. void xcc_OnSocketError(object sender, Exception ex)
  37. {
  38.     MessageBox.Show(ex.Message);
  39. }
  40.  
  41. void xcc_OnXmppError(object sender, agsXMPP.Xml.Dom.Element e)
  42. {
  43.     throw new NotImplementedException();
  44. }
  45.  
  46. void xcc_OnXmppConnectionStateChanged(object sender, agsXMPP.XmppConnectionState state)
  47. {
  48.     label1.Text = state.ToString();
  49. }
  50.  
  51. void xcc_OnLogin(object sender)
  52. {
  53.    
  54. }

When I try to connect to my server I get the following SocketError

No Connection Could be made because the target machine actively refused it.

Can you please help me to come out from this problem as my days are limited to
This post was edited on 2013-09-24, 09:54 by Alex.
Avatar
lijumathewv #2
Member since Sep 2013 · 2 posts
Group memberships: Members
Show profile · Link to this post
  1. xcc.SocketConnectionType = SocketConnectionType.Bosh;

this line is not there in my code.
This post was edited on 2013-09-24, 09:55 by Alex.
Avatar
Alex #3
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
You probably run into the ipv6/ipv4 problem like many others did before. The forums search should help you there.
eg: http://forum.ag-software.net/thread/1510-Could-not-connect…

xcc.Username = "admin@liju-pc.com";

the username in XMPP is everything before the @ of a Jid. So its admin only.
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