This article is a mirror article of machine translation, please click here to jump to the original article.

View: 23734|Reply: 4

[Source] .net uses AgsXMPP to connect with openfire to achieve cross-platform information flow.

[Copy link]
Posted on 6/6/2016 12:34:20 PM | | | |
When I first started using agsXmpp, there was very little information on the Internet, and many of them were the same, all of which were modified here and there. Not at all for newbies who are just getting into this AgsXmpp. I also flipped through the information on the Internet for 2 days, referred to the SDK, and wrote a .net client to communicate with Spark.

1. I'm a rookie in .net, and I've written half of it, but I think the most important thing to pay attention to in .net is to clearly distinguish what is JID, what is XmppClientConnection, and the properties in it.

As if I declared a Jid j=new Jid("abc@server_name"); Behind @ is the name of your server, don't write your IP address, that will not pass the verification, unless you should use the source code in Openfire. If you want to specify the ip, you can use XmppClicentConnection.connectServer="xxxxxxxxx"; xxxx represents the IP address of your server.

2. After clearly understanding the first point, the second point is relatively simple. Connect to Openfire, set your login name, and the login password is OK;

XmppClientConnection con=new XmppClicentConnection();

con. Username="your user name";

con. Password="your pass word";

con.server="your server not ip addrs!!!!";

If these steps are correct, let's modify the connection authentication method, that MD-。。。 Whatever. No, it can only be passed with Plain.

To do it in con. OnSaslStart event.

You can change it to this:

   args. Auto = false;
          args. Mechanism = agsXMPP.protocol.sasl.Mechanism.GetMechanismName(agsXMPP.protocol.sasl.MechanismType.PLAIN);

    3. Then you can log in and verify afterwards. con.open;



Demo download, only the connection function is implemented:

OpenfireXMPP.rar (228.89 KB, Number of downloads: 1, 售价: 3 粒MB)





Previous:An error occurred when connecting to SQL Server in the OpenFire installation configuration
Next:Didcuz memcache+ssrf GETSHELL vulnerability remediation solution
Posted on 6/6/2016 5:19:16 PM |
Posted on 6/6/2016 5:19:34 PM |
Is the message push written?
 Landlord| Posted on 6/6/2016 6:01:52 PM |
Gu Yan Posted on 2016-6-6 17:19
Is the message push written?

No can't write it
Posted on 11/29/2017 1:04:02 PM |
I can't download it...
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com