Not logged in. · Lost password · Register
Forum: MatriX and XmppDotNet RSS
Use of Matrix XMPP with .NetCore
Avatar
mart #1
Member since Sep 2017 · 4 posts
Group memberships: Members
Show profile · Link to this post
Subject: .netcore
I would like to integrate our Linux web server (which runs on .netcore) to Firebase, and was considering using the Matrix XMPP libraries for this.

1. Which library should I be using, I can not see an explicit .netcore one.

2. The sample code at
https://www.ag-software.net/2016/09/24/firebase-cloud-mess…

Does not seem to work with the API in NuGet Matrix.vNext v0.4.0

For example xmppClient does not contain a definition for properties like Hostname or AutoRoster or AutoPresence.  Neither does it recognise the .Open() method.

Would it be possible to point me at some documentation or samples which show how to use the version of your product identified above, with Firebase?

Many thanks.
Avatar
Alex #2
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Matrix.vNext is the correct package for netCore.
The sample you refer to is for the "older" MatriX library which has a different API.

  • You don't need AutoRoster and AutoPresence in MatriX vNext
  • When you server is setup correctly it should also have SRV records in DNS. So you don't need to pass a hostname. Just enable SRV resolving. If you don't have SRV records setup correctly just use a StaticNameResolver and pass your host or ip.

Example with SRV resolving
  1. var xmppClient = new XmppClient(pipelineInitializerAction)
  2. {
  3.     Username = "alex",
  4.     Password = "secret",
  5.     XmppDomain = "ag-software.net",
  6.     HostnameResolver = new SrvNameResolver()
  7. }
  8. await  xmppClient.ConnectAsync();
  9. var myRoster = await xmppClient.RequestRosterAsync();

Example using static resolver for hostname
  1. var xmppClient = new XmppClient(pipelineInitializerAction)
  2. {
  3.     Username = "alex",
  4.     Password = "secret",
  5.     XmppDomain = "ag-software.net",
  6.     HostnameResolver =new StaticNameResolver(IPAddress.Parse("192.168.1.10"))
  7. }
  8. await  xmppClient.ConnectAsync();
  9. var myRoster = await xmppClient.RequestRosterAsync();
This post was edited on 2017-09-26, 13:59 by Alex.
Avatar
mart #3
Member since Sep 2017 · 4 posts
Group memberships: Members
Show profile · Link to this post
Many thanks Alex.

Could you please point me to the documentation for this version of the API, for example

how is the Connect callback defined ?
how is RequestRosterAsync callback defined?

HostnameResolver = new SrvNameResolver()
has an IsClient Parameter.  Is there a description of this?

What is the pipelineInitializerAction variable and what should I do with this.

Is there a description of the what the two Matrix packages are responsible for, and should I need both ?
Thanks.
This post was edited 2 times, last on 2017-09-22, 11:34 by mart.
Avatar
Alex #4
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by mart:
Could you please point me to the documentation for this version of the API, for example

MatriX vNext is pretty new. Documentation is still in work in progress, examples will be published soon.

Quote by mart:
how is the Connect callback defined ?
how is RequestRosterAsync callback defined?

there are no callbacks.
Its using the new Task-based Asynchronous pattern (TAP), and reactive programming (RX).

Quote by mart:
This line
HostnameResolver = new SrvNameResolver()
gives me an error Namespace SrvNameResolver could not be found.

Have yo added the Matrix.vNext.Srv package to your project?

Alex
Avatar
mart #5
Member since Sep 2017 · 4 posts
Group memberships: Members
Show profile · Link to this post
On callbacks - I now see it is using await. Thanks.

No I had missed the .srv package.  The object is now found.

Is there a description of what the two packages are responsible for and should I be using both ?

What is the IsClient parameter being used for in the SrvNameResolver object.  It seems obvious but I cant be sure without some documentation or explanation :-)

Are there any examples of using this API with firebase.

Thank you Alex.
Avatar
Alex #6
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by mart:
Are there any examples of using this API with firebase.

no there is no example.

After looking at the samples for Matrix for .NET I assume it will not work with MatriX vNext, because MatriX vNext does not support the OldStyleSsl currently. If Firebase still is not fully XMPP compliant and requires this it will not work with the current version of MatriX vNext.

Alex
Avatar
davidadam2017 #7
Member since Sep 2017 · 1 post
Group memberships: Members
Show profile · Link to this post
Thank you for this post. It will help me
Avatar
mart #8
Member since Sep 2017 · 4 posts
Group memberships: Members
Show profile · Link to this post
David, what solution are you looking at using for this ?
Avatar
Alex #9
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
A new version of MatriX vNext was published to Nuget.
There is a new property LegacySsl on the XmppClient now, which allows you to connect to servers using LegacySsl like Firebase.
Firebase with MatriX vNext should work fine now.
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: