Not logged in. · Lost password · Register

Search posts

Search for Display as
Order
Date from until Format: D.M.Y Search in forum
You can combine words with " or exclude them with -. Example: "nice weather" -rain

Page:  1  2  3 ... 13  14  15  next

Search result (217)

topic: Matrix vNext Console Client Error  in the forum: MatriX and XmppDotNet
nir #1
Member since Aug 2021 · 11 posts
Group memberships: Members
Show profile · Link to this post
No exceptions on Android. On uwp its working fine.
I added a Xamarin Forms (Xamarin 5) project inside the solution of the Matrix-vNext xamarin-tls branch.
Here is my code:
  1. using System;
  2. using Xamarin.Forms;
  3. using System.Reactive.Linq;
  4. using Matrix;
  5. using Matrix.Extensions.Client.Roster;
  6. using Matrix.Extensions.Client.Presence;
  7. using Matrix.Xmpp;
  8. using Matrix.Xmpp.Base;
  9. using System.Diagnostics;
  10. using Matrix.Network.Resolver;
  11. using System.Net;
  12. using Matrix.Tls.Mono;
  13. using System.Threading.Tasks;
  14.  
  15. namespace AppClient
  16. {
  17.     public partial class App : Application
  18.     {
  19.         private XmppClient xmppClient;
  20.  
  21.         public App()
  22.         {
  23.             InitializeComponent();
  24.  
  25.             MainPage = new MainPage();
  26.         }
  27.  
  28.         protected override void OnStart()
  29.         {
  30.             Task.Run(async () => {
  31.                 xmppClient = new XmppClient()
  32.                 {
  33.                     Username = "entersoft",
  34.                     Password = "testtest",
  35.                     XmppDomain = "xmpp.jp",
  36.                     HostnameResolver = new StaticNameResolver(IPAddress.Parse("133.125.37.233")),
  37.                 };
  38.  
  39.                 if (Device.RuntimePlatform != Device.UWP)
  40.                 {
  41.                     xmppClient.TlsHandlerProvider = new MonoTlsHandlerProvider();
  42.                 }
  43.  
  44.                 xmppClient.XmppSessionStateObserver.Subscribe(v => {
  45.                     Debug.WriteLine($"State changed: {v}");
  46.                 });
  47.  
  48.                 xmppClient
  49.                     .XmppXElementStreamObserver
  50.                     .Where(el => el is Presence)
  51.                     .Subscribe(el =>
  52.                     {
  53.                         Debug.WriteLine(el.ToString());
  54.                     });
  55.  
  56.                 xmppClient
  57.                     .XmppXElementStreamObserver
  58.                     .Where(el => el is Message)
  59.                     .Subscribe(el =>
  60.                     {
  61.                         Debug.WriteLine(el.ToString());
  62.                     });
  63.  
  64.                 xmppClient
  65.                     .XmppXElementStreamObserver
  66.                     .Where(el => el is Iq)
  67.                     .Subscribe(el =>
  68.                     {
  69.                         Debug.WriteLine(el.ToString());
  70.                     });
  71.  
  72.                 // Connect the XMPP connection
  73.                 await xmppClient.ConnectAsync();
  74.  
  75.                 // request the roster (aka contact list)
  76.                 var roster = await xmppClient.RequestRosterAsync();
  77.                 Debug.WriteLine(roster.ToString());
  78.  
  79.                 // Send our presence to the server
  80.                 xmppClient.SendPresenceAsync(Show.Chat, "free for chat").GetAwaiter().GetResult();
  81.             });
  82.            
  83.         }
  84.  
  85.         protected override async void OnSleep()
  86.         {
  87.             await xmppClient.DisconnectAsync();
  88.         }
  89.  
  90.         protected override void OnResume()
  91.         {
  92.         }
  93.     }
  94. }

BTW thanks for all your support,
Nicholas
This post was edited on 2021-09-07, 15:54 by Alex.
topic: Matrix vNext Console Client Error  in the forum: MatriX and XmppDotNet
nir #2
Member since Aug 2021 · 11 posts
Group memberships: Members
Show profile · Link to this post
In reply to post ID 11066
I am trying with the Mono Tls code.

  1. xmppClient = new XmppClient()
  2.             {
  3.                 Username = "entersoft",
  4.                 Password = "testtest",
  5.                 XmppDomain = "xmpp.jp",
  6.                 HostnameResolver = new StaticNameResolver(IPAddress.Parse("133.125.37.233")),
  7.                 TlsHandlerProvider = new MonoTlsHandlerProvider()
  8.             };

[0:] State changed: Connected
Loaded assembly: /data/data/com.companyname.appclient/files/.__override__/System.Runtime.CompilerServices.Unsafe.dll [External]
?[40m?[32minfo?[39m?[22m?[49m: AppClient.App[0]
      SEND: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" to="xmpp.jp" version="1.0" >
?[40m?[32minfo?[39m?[22m?[49m: AppClient.App[0]
      RECV: <?xml version='1.0'?><stream:stream id='14668281379043316013' version='1.0' xml:lang='en' xmlns:stream='http://etherx.jabber.org/streams' from='xmpp.jp' xmlns='jabber:client'><stream:features><starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'><required/></starttls></stream:features>
[0:] State changed: Securing
Loaded assembly: /data/data/com.companyname.appclient/files/.__override__/System.Security.Cryptography.X509Certificates.dll [External]
?[40m?[32minfo?[39m?[22m?[49m: AppClient.App[0]
      SEND: <starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls" />
?[40m?[32minfo?[39m?[22m?[49m: AppClient.App[0]
      RECV: <proceed xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>
?[40m?[32minfo?[39m?[22m?[49m: AppClient.App[0]
      SEND: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" to="xmpp.jp" version="1.0" >
[0:] State changed: Disconnected
This post was edited on 2021-09-07, 15:39 by Alex.
topic: Xamarin Android Example Client not working  in the forum: MatriX and XmppDotNet
nir #3
Member since Aug 2021 · 11 posts
Group memberships: Members
Show profile · Link to this post
In reply to post ID 11059
I added a logger:
  1. InternalLoggerFactory.DefaultFactory.AddProvider(new DebugLoggerProvider());
  2.             var pipelineInitializerAction = new Action<IChannelPipeline>(pipeline =>
  3.             {
  4.                 pipeline.AddFirst(new LoggingHandler());
  5.             });

I have the following two logs that might be useful:
[0:] DotNetty.Transport.Channels.DefaultChannelPipeline: Debug: Discarded inbound message null that reached at the tail of the pipeline. Please check your pipeline configuration.

[0:] DotNetty.Transport.Channels.DefaultChannelId: Warning: Failed to find a usable hardware address from the network interfaces; using random bytes: B3:23:16:45:42:7E:15:3E
[0:] DotNetty.Transport.Channels.DefaultChannelId: Debug: -Dio.netty.machineId: B3:23:16:45:42:7E:15:3E (auto-detected)

My MainActivity:
  1. [Activity(Label = "Chat", Icon = "@mipmap/icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize )]
  2.     public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
  3.     {
  4.         protected override void OnCreate(Bundle savedInstanceState)
  5.         {
  6.             base.OnCreate(savedInstanceState);
  7.  
  8.             Xamarin.Essentials.Platform.Init(this, savedInstanceState);
  9.             global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
  10.             LoadApplication(new App());
  11.         }
  12.         public override void OnRequestPermissionsResult(int requestCode, string[] permissions, [GeneratedEnum] Android.Content.PM.Permission[] grantResults)
  13.         {
  14.             Xamarin.Essentials.Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults);
  15.  
  16.             base.OnRequestPermissionsResult(requestCode, permissions, grantResults);
  17.         }
  18.     }

And I have added the Internet Permission
I'm compiling using Android 11

My company also has a license from the previous version of the library Matrix XMPP, do I have to use it somewhere?

Am I missing something?

Thanks in advance,
Nicholas
topic: Getting ClientSocket Connection request failed from sample code I downloaded  in the forum: MatriX and XmppDotNet
Avatar
Alex #4
Member since Feb 2003 · 4447 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
In reply to post ID 11003
your code above still has ResolveSrvRecords = true
When ResolveSrvRecords is true then your hostname and IP address is settings are ignored. Set it to false please when you want to specify it manual.

Your username is also wrong. The username is everything before the @, which is your xmpp domain.

Quote by rperetz:
As a side note, it seem that this connection is working fine for the PresenceManager object, I seem to get XML data from there.
but I can't send messages yet.
Can you send messages using the PresenceManager class (I don't think so).

This is impossible when you get socket errors and no connection.

Alex
topic: Getting ClientSocket Connection request failed from sample code I downloaded  in the forum: MatriX and XmppDotNet
Avatar
Alex #5
Member since Feb 2003 · 4447 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
In reply to post ID 11001
MatriX cannot connect to your server traffictech.lan on port 1080.

  • Are you sure the port is correct?
  • Do you have SRV records set on this domain?
  • When there are no SRV records set does DNS resolve the IP address correct?

See also here in the docs how you can disable SRV resolving and manual specify host or IP and port for development purposes:
https://www.ag-software.net/matrix-xmpp-sdk/matrix-develop…

Alex
topic: Matrix Xmpp: Xamarin Forms issue while sending message or closing connection (Send message/Closing connection not happening until I receive a message)  in the forum: MatriX and XmppDotNet
sathyajithr.dev #6
Member since Jul 2020 · 8 posts
Group memberships: Members
Show profile · Link to this post
Subject: Matrix Xmpp: Xamarin Forms issue while sending message or closing connection
I am implementing chat functionality in a Xamarin forms application. Connection to the chat server, user subscription, presence subscription and even message receiving is working smoothly. But while trying to send a message or disconnect a connection, the method execution stuck and it won't be successful. Once a message is received (Sending from Gajim windows client) the execution continues from xmppClient.Send()/xmppClient.Close() calls.  I tried it from both Android and iOS applications and the behavior is the same. I also tested the sample app (https://gitlab.com/matrix-xmpp/samples/-/tree/master/cshar…)  and its the same behavior, method execution stuck in xmppClient.Close() and only executes further once a message is received.

I am having latest xamarin SDKs

Xamarin iOS - 13.18.3.2
Xamarin Android - 10.3.1.4

Another thing I noticed is that the same code I written works when building from another machine which is having lower version of Xamarin iOS SDK, sending message was working fine. But having issues to send message from Android app which is built from that machine. The Xamarin iOS SDK version in that machine is

Xamarin iOS - 13.6.0.12

Is there any compatibility issue with latest Xamarin SDKs? Please advise how to resolve this issue.

Below are the logs.
PS: OnSendMessage it would log as sending message, but it would get delivered and method execution continues only when a message is received in my app.

14:35:45.844 D/ChatService: XmppOnSendMessage:<stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" to="server.address.com" version="1.0" >:
14:35:46.142 D/ChatService: XmppOnXmlReceiveMessage:<stream:stream xmlns:stream="http://etherx.jabber.org/streams" id="5041239102440826853" version="1.0" xml:lang="en" from="server.address.com" xmlns="jabber:client" >:
14:35:46.157 D/ChatService: XmppOnXmlReceiveMessage:<stream:features xmlns:stream="http://etherx.jabber.org/streams">
14:35:46.157 D/ChatService:   <starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls">
14:35:46.157 D/ChatService:     <required />
14:35:46.157 D/ChatService:   </starttls>
14:35:46.157 D/ChatService: </stream:features>:
14:35:46.167 D/ChatService: XmppOnSendMessage:<starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls" />:
14:35:46.428 D/ChatService: XmppOnXmlReceiveMessage:<proceed xmlns="urn:ietf:params:xml:ns:xmpp-tls" />:
14:35:47.268 D/ChatService: XmppOnSendMessage:<stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" to="server.address.com" version="1.0" >:
14:35:47.547 D/ChatService: XmppOnXmlReceiveMessage:<stream:stream xmlns:stream="http://etherx.jabber.org/streams" id="18057076616736662190" version="1.0" xml:lang="en" from="server.address.com" xmlns="jabber:client" >:
14:35:47.550 D/ChatService: XmppOnXmlReceiveMessage:<stream:features xmlns:stream="http://etherx.jabber.org/streams">
14:35:47.550 D/ChatService:   <mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl">
14:35:47.550 D/ChatService:     <mechanism>DIGEST-MD5</mechanism>
14:35:47.550 D/ChatService:     <mechanism>PLAIN</mechanism>
14:35:47.550 D/ChatService:     <mechanism>SCRAM-SHA-1</mechanism>
14:35:47.550 D/ChatService:     <mechanism>X-OAUTH2</mechanism>
14:35:47.550 D/ChatService:   </mechanisms>
14:35:47.550 D/ChatService:   <register xmlns="http://jabber.org/features/iq-register" />
14:35:47.550 D/ChatService: </stream:features>:
14:35:47.550 D/ChatService: XmppOnStreamFeatures: <stream:features xmlns:stream="http://etherx.jabber.org/streams">
14:35:47.550 D/ChatService:   <mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl">
14:35:47.550 D/ChatService:     <mechanism>DIGEST-MD5</mechanism>
14:35:47.550 D/ChatService:     <mechanism>PLAIN</mechanism>
14:35:47.550 D/ChatService:     <mechanism>SCRAM-SHA-1</mechanism>
14:35:47.550 D/ChatService:     <mechanism>X-OAUTH2</mechanism>
14:35:47.550 D/ChatService:   </mechanisms>
14:35:47.550 D/ChatService:   <register xmlns="http://jabber.org/features/iq-register" />
14:35:47.550 D/ChatService: </stream:features>
14:35:47.572 D/ChatService: XmppOnSendMessage:<auth mechanism="PLAIN" xmlns="urn:ietf:params:xml:ns:xmpp-sasl">XXXXX</auth>:
14:35:47.837 D/ChatService: XmppOnXmlReceiveMessage:<success xmlns="urn:ietf:params:xml:ns:xmpp-sasl" />:
14:35:47.843 D/ChatService: xmppClient_OnLogin: Matrix.EventArgs
14:35:47.844 D/ChatService: XmppOnSendMessage:<stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" to="server.address.com" version="1.0" >:
14:35:48.107 D/ChatService: XmppOnXmlReceiveMessage:<stream:stream xmlns:stream="http://etherx.jabber.org/streams" id="8809054255882851270" version="1.0" xml:lang="en" from="server.address.com" xmlns="jabber:client" >:
14:35:48.112 D/ChatService: XmppOnXmlReceiveMessage:<stream:features xmlns:stream="http://etherx.jabber.org/streams">
14:35:48.112 D/ChatService:   <bind xmlns="urn:ietf:params:xml:ns:xmpp-bind" />
14:35:48.112 D/ChatService:   <session xmlns="urn:ietf:params:xml:ns:xmpp-session">
14:35:48.112 D/ChatService:     <optional />
14:35:48.112 D/ChatService:   </session>
14:35:48.112 D/ChatService:   <c ver="NqMDrgCx03HLh3URMusgDnNsR30=" node="http://www.process-one.net/en/ejabberd/" hash="sha-1" xmlns="http://jabber.org/protocol/caps" />
14:35:48.112 D/ChatService:   <sm xmlns="urn:xmpp:sm:2" />
14:35:48.112 D/ChatService:   <sm xmlns="urn:xmpp:sm:3" />
14:35:48.112 D/ChatService:   <ver xmlns="urn:xmpp:features:rosterver" />
14:35:48.112 D/ChatService:   <csi xmlns="urn:xmpp:csi:0" />
14:35:48.112 D/ChatService: </stream:features>:
14:35:48.127 D/ChatService: XmppOnSendMessage:<iq id="MX_1" type="set" xmlns="jabber:client">
14:35:48.127 D/ChatService:   <bind xmlns="urn:ietf:params:xml:ns:xmpp-bind">
14:35:48.127 D/ChatService:     <resource>MatriX-for-Android</resource>
14:35:48.127 D/ChatService:   </bind>
14:35:48.127 D/ChatService: </iq>:
14:35:48.397 D/ChatService: XmppOnXmlReceiveMessage:<iq type="result" id="MX_1" xmlns="jabber:client">
14:35:48.397 D/ChatService:   <bind xmlns="urn:ietf:params:xml:ns:xmpp-bind">
14:35:48.397 D/ChatService:     <jid>jack@server.address.com/MatriX-for-Android</jid>
14:35:48.397 D/ChatService:   </bind>
14:35:48.397 D/ChatService: </iq>:
14:35:48.411 D/ChatService: XmppOnSendMessage:<iq to="server.address.com" type="set" id="sess_1">
14:35:48.411 D/ChatService:   <session xmlns="urn:ietf:params:xml:ns:xmpp-session" />
14:35:48.411 D/ChatService: </iq>:
14:35:48.415 D/ChatService: XmppOnSendMessage:<enable resume="true" xmlns="urn:xmpp:sm:3" />:
14:35:48.423 D/ChatService: XmppOnSendMessage:<iq id="MX_2" type="get" xmlns="jabber:client">
14:35:48.423 D/ChatService:   <query xmlns="jabber:iq:roster" />
14:35:48.423 D/ChatService: </iq>:
14:35:48.670 D/ChatService: XmppOnXmlReceiveMessage:<iq xml:lang="en" to="jack@server.address.com/MatriX-for-Android" from="server.address.com" type="result" id="sess_1" xmlns="jabber:client" />:
14:35:48.670 D/ChatService: <<<<<Session established>>>>>
14:35:48.673 D/ChatService: XmppOnSendMessage:<presence type="subscribe" to="harry@server.address.com" id="MX_3" xmlns="jabber:client" />:
14:35:48.673 D/ChatService: SubscribeUser sent:harry@server.address.com
14:35:48.675 D/ChatService: XmppOnXmlReceiveMessage:<enabled resume="true" max="300" id="g2gCbQAAABJNYXRyaVgtZm9yLUFuZHJvaWRoA2IAAAY7YgAI365iAAABkA==" xmlns="urn:xmpp:sm:3" />:
14:35:48.688 D/ChatService: XmppOnXmlReceiveMessage:<iq xml:lang="en" to="jack@server.address.com/MatriX-for-Android" from="jack@server.address.com" type="result" id="MX_2" xmlns="jabber:client">
14:35:48.688 D/ChatService:   <query xmlns="jabber:iq:roster">
14:35:48.688 D/ChatService:     <item subscription="both" jid="harry@server.address.com" />
14:35:48.688 D/ChatService:   </query>
14:35:48.688 D/ChatService: </iq>:
14:35:48.694 D/ChatService: XmppOnSendMessage:<presence xmlns="jabber:client">
14:35:48.694 D/ChatService:   <show>chat</show>
14:35:48.694 D/ChatService:   <status></status>
14:35:48.694 D/ChatService:   <priority>0</priority>
14:35:48.694 D/ChatService: </presence>:
14:35:48.697 D/ChatService: XmppOnXmlReceiveMessage:<r xmlns="urn:xmpp:sm:3" />:
14:35:48.700 D/ChatService: XmppOnSendMessage:<a h="1" xmlns="urn:xmpp:sm:3" />:
14:35:48.957 D/ChatService: XmppOnXmlReceiveMessage:<presence xml:lang="en" to="jack@server.address.com/MatriX-for-Android" from="jack@server.address.com/MatriX-for-Android" xmlns="jabber:client">
14:35:48.957 D/ChatService:   <x xmlns="vcard-temp:x:update" />
14:35:48.957 D/ChatService:   <priority>0</priority>
14:35:48.957 D/ChatService:   <show>chat</show>
14:35:48.957 D/ChatService:   <status />
14:35:48.957 D/ChatService: </presence>:
14:35:48.966 D/ChatService: XmppOnXmlReceiveMessage:<r xmlns="urn:xmpp:sm:3" />:
14:35:48.966 D/ChatService: XmppOnSendMessage:<a h="2" xmlns="urn:xmpp:sm:3" />:
14:35:55.333 D/ChatService: XmppOnSendMessage:<message to="harry@server.address.com" from="jack@server.address.com/MatriX-for-Android" type="chat" id="4b7afe63-3f6c-4191-8270-303e664a6eb7" xml:lang="en" xmlns="jabber:client">
14:35:55.333 D/ChatService:   <body>Thank you! I am over it now.</body>
14:35:55.333 D/ChatService:   <active xmlns="http://jabber.org/protocol/chatstates" />
14:35:55.333 D/ChatService:   <origin-id id="4b7afe63-3f6c-4191-8270-303e664a6eb7" xmlns="urn:xmpp:sid:0" />
14:35:55.333 D/ChatService: </message>:
This post was edited 2 times, last on 2020-07-30, 23:35 by Alex.
topic: Porting code to vNext  in the forum: MatriX and XmppDotNet
humba #7
Member since Feb 2020 · 23 posts
Group memberships: Members
Show profile · Link to this post
In reply to post ID 10855
I've already downloaded the source code and I'm going through various classes that appear interesting.

I understand the notification subscription (and I've already ported session state, Message, Iq and Presence handling, as well as unsubscription), yet, as with the OnXXX events I listed, there's a bunch of error events and there's no documentation on error handling. I don't know when I should be expecting which exception (in case something goes wrong which I'm sure it will in the beginning - it was the same when I first started (my server is Cisco Finesse)). Say, I'm connecting with incorrect credentials.. what would be the response to ConnectAsync? And how can my application get informed about a connection closing? (there's no Closing in SessionState - would receiving a SessionState.Disconnected be )

I also found a ReconnectHandliner in the source code which I suspect would do automatic reconnect.. yet, it's unused in the entire repo (reconnect is something I do need.. I was using OnClose event to inform my application that the connection broken, and triggering a reconnect).

PubSubManager code would sure help.. either I stop this thing now and delay the entire port or I have to port it now. PubSub is essential to what I'm going. I found a bunch of classes in the source, but again, no live usage so no change for me to figure out what goes where. I only need to List active subscriptions, and add/remove subscriptions (methods

  1. Iq data = await mgr.RequestSubscriptionsAsync(pubSubAddress, null, pubSubManagerTimeout).ConfigureAwait(false);
  2. Iq data = await mgr.SubscribeAsync(pubSubAddress, node, user, pubSubManagerTimeout).ConfigureAwait(false);
  3. Iq data = await mgr.UnsubscribeAsync(pubSubAddress, node, user, pubSubManagerTimeout).ConfigureAwait(false);
topic: Anyone have a Vb.net sample of how to connect the callback to discover rooms  in the forum: MatriX and XmppDotNet
AgentSmithers #8
Member since Nov 2019 · 2 posts
Group memberships: Members
Show profile · Link to this post
Subject: Anyone have a Vb.net sample of how to connect the callback to discover rooms
Anyone have a Vb.net sample of how to connect the callback to discover rooms?
I have a snippet that works u to that point but the way i need to handle adding my call back is given me some hurdles. Anyone have a sample?



  1. Imports Matrix
  2. Imports Matrix.Xmpp
  3. Imports Matrix.Xmpp.Client
  4. Imports Matrix.Xmpp.Roster
  5. 'Install-Package MatriX
  6. Module Module1
  7.     'Install-Package MatriX
  8.     WithEvents MyXmppClient As New XmppClient()
  9.     WithEvents myMuch As MucManager
  10.     Sub Main()
  11.  
  12.         MyXmppClient.Compression = False
  13.         MyXmppClient.Hostname = Nothing
  14.         MyXmppClient.ResolveSrvRecords = True
  15.         MyXmppClient.StartTls = True
  16.         MyXmppClient.Status = "Online"
  17.         MyXmppClient.Show = Show.None
  18.  
  19.         MyXmppClient.Transport = Matrix.Net.Transport.Socket
  20.         MyXmppClient.SetUsername("jid")
  21.         MyXmppClient.SetXmppDomain("domain.com")
  22.         MyXmppClient.Password = "MyPas$"
  23.         MyXmppClient.ResolveSrvRecords = False
  24.         MyXmppClient.Hostname = "Cupser.domain.com"
  25.  
  26.         MyXmppClient.Show = Matrix.Xmpp.Show.Chat
  27.  
  28.         MyXmppClient.AutoRoster = True
  29.         MyXmppClient.AutoReplyToPing = True
  30.         MyXmppClient.AutoPresence = True
  31.  
  32.         ''xmppClient.MessageFilter.Add(new Jid(JID_Receiver), new BareJidComparer(), new EventHandler<MessageEventArgs>(XmppClient_OnMessage), null);
  33.         Try
  34.             MyXmppClient.Open()
  35.         Catch ex As System.Net.WebException
  36.             Console.WriteLine(ex.Message)
  37.         Catch ex As Exception
  38.             Console.WriteLine(ex.Message)
  39.         End Try
  40.  
  41.         Console.ReadKey()
  42.  
  43.         MyXmppClient.Close()
  44.     End Sub
  45.  
  46.     Private Sub DiscoItemsResult(ByVal sender As Object, ByVal e As IqEventArgs)
  47.         Dim foo = "asdfsadf"
  48.     End Sub
  49.  
  50.     Private Sub xmppClient_OnInitialPresence(sender As Object, e As PresenceEventArgs) Handles MyXmppClient.OnInitialPresence
  51.         Debug.WriteLine("xmppClient_OnInitialPresence")
  52.         myMuch = New MucManager(MyXmppClient)
  53.         'Debug.WriteLine(MyXmppClient.Send(New Message(New Jid("jid"), MessageType.Chat, "Test")))
  54.  
  55.         Dim Mysd As New DiscoManager(MyXmppClient)
  56.         'DiscoManager.DiscoverItems("conference-2-standalonecluster32150.emc.org", "jid@emc.org", New EventHandler(Of IqEventArgs)(AddressOf DiscoItemsResult))
  57.         'Mysd.DiscoverInformation()
  58.         Dim Room As String = "chat552951691316913@conference-2-standalonecluster32150.emc.org"
  59.         myMuch.EnterRoom(Room, "nickname")
  60.         'myMuch.roo
  61.         'Dim Addressto As New EventHandler(AddressOf RequestMemberListFunc)
  62.         'Dim Addressto As New RequestMemberListCB2(AddressOf RequestMemberListFunc)
  63.  
  64.         'myMuch.RequestMemberList(Room, Addressto)
  65.         'Debug.WriteLine(MyXmppClient.Send(New Message(New Jid(Room), MessageType.GroupChat, "Disregard that thanks.")))
  66.         ' myMuch.ExitRoom(Room, "NickName")
  67.     End Sub
  68.  
  69.     Delegate Sub eventhandler2(events As IqEventArgs)
  70.     Delegate Sub RequestMemberListCB2(sender As Object, e As PresenceEventArgs)
  71.  
  72.     Private Sub RequestMemberListFunc(sender As Object, e As PresenceEventArgs)
  73.         'Console.WriteLine("RequestMemberListFunc: " & events.Iq.Name.LocalName)
  74.     End Sub
  75.     Private Sub RequestMemberListFunc2(sender As Object, e As EventArgs)
  76.         Console.WriteLine("xmppClient_OnLogin: " & e.State)
  77.     End Sub
  78.  
  79.  
  80.     Private Sub xmppClient_OnLogin(sender As Object, e As EventArgs) Handles MyXmppClient.OnLogin
  81.         Console.WriteLine("xmppClient_OnLogin: " & e.State)
  82.     End Sub
  83.  
  84.     Private Sub xmppClient_OnMessage(sender As Object, e As MessageEventArgs) Handles MyXmppClient.OnMessage
  85.         Console.WriteLine(e.Message)
  86.  
  87.         If (e.Message.Body <> Nothing) Then
  88.             Console.ForegroundColor = ConsoleColor.Yellow
  89.             Console.WriteLine("{0}: {1}", e.Message.From.User, e.Message.Body)
  90.             Console.Write("{0}: ", e.Message.To.User)
  91.  
  92.  
  93.             If e.Message.Error IsNot Nothing Then
  94.                 Console.ForegroundColor = ConsoleColor.Red
  95.                 Console.WriteLine(e.Message.Error)
  96.             Else
  97.                 'MyXmppClient.Send(New Message(New Jid(e.Message.From.Bare), MessageType.Chat, e.Message.Body))
  98.             End If
  99.             Console.ForegroundColor = ConsoleColor.Green
  100.         End If
  101.     End Sub
  102.  
  103.     Private Sub xmppClient_OnPresence(sender As Object, e As PresenceEventArgs) Handles MyXmppClient.OnPresence
  104.         Console.ForegroundColor = ConsoleColor.White
  105.         Console.WriteLine("Online Contacts: ")
  106.         If (Not e.Presence.Type.Equals("unavailable")) Then
  107.             Console.WriteLine("{0}@{1}  {2}", e.Presence.From.User, e.Presence.From.Server, e.Presence.Type)
  108.             Console.WriteLine()
  109.         End If
  110.         Console.WriteLine(e.Presence)
  111.     End Sub
  112.  
  113.     Private Sub xmppClient_OnRosterItem(sender As Object, e As RosterEventArgs) Handles MyXmppClient.OnRosterItem
  114.         Console.WriteLine(e.RosterItem.ToString & " - " & e.Version)
  115.     End Sub
  116.  
  117.     Private Sub xmppClient_OnStreamStart(sender As Object, e As StanzaEventArgs) Handles MyXmppClient.OnStreamStart
  118.         Debug.WriteLine("OnStreamStart")
  119.     End Sub
  120.  
  121.     Private Sub myMuch_OnInvite(sender As Object, e As MessageEventArgs) Handles myMuch.OnInvite
  122.         Debug.WriteLine("OnInvite: " & e.Message.ToString)
  123.     End Sub
  124. End Module
This post was edited on 2019-11-14, 09:39 by Alex.
topic: Connecting to Custom IP and Port Issue (IPv6 Problem i think)  in the forum: MatriX and XmppDotNet
Avatar
Alex #9
Member since Feb 2003 · 4447 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
In reply to post ID 10784
see: https://docs.microsoft.com/en-us/dotnet/api/system.net.ip…?view=n…
topic: Connecting to Custom IP and Port Issue (IPv6 Problem i think)  in the forum: MatriX and XmppDotNet
Avatar
Alex #10
Member since Feb 2003 · 4447 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
In reply to post ID 10782
your code which configures MatriX matches exactly with the screenshots in Psi. I have no idea why Psi would work, and MatriX not.
If you think its an IPv4/IPv6 issue then you can return a v6 address in your StaticNameResolver.

The error message you posted is on the proxy server, so I don't see how this is related to MatriX. Maybe you configured it wrong.
vnext_test.exe - [::ffff:10.1.2.11]:5222 (IPv6) error : Could not connect through proxy 85.9.79.240:4957 - Proxy server cannot establish a connection with the target - general SOCKS server failure.
topic: Connecting to Custom IP and Port Issue (IPv6 Problem i think)  in the forum: MatriX and XmppDotNet
Avatar
kurdish_boy #11
Member since Nov 2018 · 4 posts
Group memberships: Members
Show profile · Link to this post
Subject: Connecting to Custom IP and Port Issue (IPv6 Problem i think)
Hi
i want to connect to a custom ip and port , also i have to connect my proxy first to have access to server
but in code i have this error :

DotNetty.Transport.Channels.ConnectException: 'LogError connecting to 10.1.2.11:5222'
SocketException: No connection could be made because the target machine actively refused it

and also in proxifier :
vnext_test.exe - [::ffff:10.1.2.11]:5222 (IPv6) error : Could not connect through proxy 85.9.79.240:4957 - Proxy server cannot establish a connection with the target - general SOCKS server failure.

i think this ipv6 adr : ::ffff:10.1.2.11
is wrong , i checked it in online ipv4 to ipv6 tools and this was result :

IPv4 : 10.1.2.11
IPv6 : 0:0:0:0:0:FFFF:0A01:020B

please help me to work it out , im going out of my mind Guys :D

also here is my c# code :

  1. var xmppClient = new Matrix.XmppClient
  2.             {
  3.                 Username = "admin",
  4.                 Password = "1234",
  5.                 XmppDomain = "enigma-im.ir",
  6.                 HostnameResolver = new StaticNameResolver(IPAddress.Parse("10.1.2.11"), 5222)
  7.             };
  8. await xmppClient.ConnectAsync();

i also tested it with your WPF example client based on MatriX vNext app , in visual studio , and get same error

also i can connect to the server by Psi+ without any problem with connected proxy

Help me please Thank you
This post was edited 3 times, last on 2018-11-26, 17:48 by Alex.
topic: From during initial <stream:stream  in the forum: MatriX and XmppDotNet
Avatar
mwalkup #12
Member since Apr 2018 · 3 posts
Group memberships: Members
Show profile · Link to this post
In reply to post ID 10675
Alex, forgive me as I am new to XMPP....

I am reading RFC 6120....
4.2.  Opening a Stream

   After connecting to the appropriate IP address and port of the
   receiving entity, the initiating entity opens a stream by sending a
   stream header (the "initial stream header") to the receiving entity.

  1.    I: <?xml version='1.0'?>
  2.       <stream:stream
  3.          from='juliet@im.example.com'
  4.          to='im.example.com'
  5.          version='1.0'
  6.          xml:lang='en'
  7.          xmlns='jabber:client'
  8.          xmlns:stream='http://etherx.jabber.org/streams'>

   The receiving entity then replies by sending a stream header of its
   own (the "response stream header") to the initiating entity.

Unfortunately, I have no control of the server, and they wont update it to appease using this SDK.  Thoughts?
topic: Numeric IP address in XmppClient.XmppDomain causes crash  in the forum: MatriX and XmppDotNet
Avatar
sldr #13
Member since Feb 2018 · 15 posts
Group memberships: Members
Show profile · Link to this post
In reply to post ID 10622
Subject: Thanks
I could not authenticate using numeric ip address. But it didn't crash! :-)

I imagine that "xmpp-sasl" is using the fqdn as a salt into the auth. I put a reverse lookup in front if a numeric ip address is given. Short version of long story, it took forever to get reverse DNS record "fixed" (I know what your thinking; we own our own name servers so no third-party was involved) then I got busy with something else.

Laters,
SLDR
(Stephen L. De Rudder)
topic: Numeric IP address in XmppClient.XmppDomain causes crash  in the forum: MatriX and XmppDotNet
Avatar
Alex #14
Member since Feb 2003 · 4447 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
In reply to post ID 10621
there is a new build which passes through ip addresses, even its not suggested to use them.
topic: Numeric IP address in XmppClient.XmppDomain causes crash  in the forum: MatriX and XmppDotNet
Avatar
sldr #15
Member since Feb 2018 · 15 posts
Group memberships: Members
Show profile · Link to this post
In reply to post ID 10619
I don't have any doc (or at least don't know where it is); so I didn't know that it must be a hostname and not a numeric ip address.

I had some network issues so I tried using the numeric ip address just to see if that "fixed" the network issue.

I will check or take care of translating it to a hostname before I use it in XmppClient.

Laters,
SLDR
(Stephen L. De Rudder)
Close Smaller – Larger + Reply to this post:
Special characters:
Page:  1  2  3 ... 13  14  15  next
Special queries
Go to forum