Not logged in. · Lost password · Register
Forum: MatriX and XmppDotNet RSS
Avatar
sldr #1
Member since Feb 2018 · 15 posts
Group memberships: Members
Show profile · Link to this post
Subject: Numeric IP address in XmppClient.XmppDomain causes crash
Here is the crash call stack from calling ConnectAsync().Wait(); from XmppClient instance.
System.AggregateException: One or more errors occurred. ---> System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at DotNetty.Transport.Bootstrapping.DefaultNameResolver.<ResolveAsync>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at DotNetty.Transport.Bootstrapping.Bootstrap.<DoResolveAndConnectAsync>d__15.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at DotNetty.Transport.Bootstrapping.Bootstrap.<DoResolveAndConnectAsync>d__15.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Matrix.XmppClient.<ConnectAsync>d__35.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Matrix.XmppClient.<ConnectAsync>d__34.MoveNext()
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at EMailIM.Program.DoWork() in C:\Users\derudder\Documents\Visual Studio 2017\Projects\EMailIMPreRelease\Program.cs:line 80
---> (Inner Exception #0) System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at DotNetty.Transport.Bootstrapping.DefaultNameResolver.<ResolveAsync>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at DotNetty.Transport.Bootstrapping.Bootstrap.<DoResolveAndConnectAsync>d__15.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at DotNetty.Transport.Bootstrapping.Bootstrap.<DoResolveAndConnectAsync>d__15.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Matrix.XmppClient.<ConnectAsync>d__35.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Matrix.XmppClient.<ConnectAsync>d__34.MoveNext()<---
Avatar
Alex #2
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
A XmppDomain SHOULD be  a domain, not an IP address. Eg. localhost instead of 127.0.0.1

However, if you want to use an IP (which I would never suggest), then use the StaticNameResolver from MatriX with your IP and it may work.

Alex
This post was edited on 2018-03-02, 23:18 by Alex.
Avatar
sldr #3
Member since Feb 2018 · 15 posts
Group memberships: Members
Show profile · Link to this post
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)
Avatar
Alex #4
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
The XmppDomain is also configured o nthe server. When the domain does not match on the first roundtrip the server usually immediately will close the connection.
Avatar
Alex #5
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
there is a new build which passes through ip addresses, even its not suggested to use them.
Avatar
sldr #6
Member since Feb 2018 · 15 posts
Group memberships: Members
Show profile · Link to this post
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)
Avatar
Alex #7
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Yes the domain is part of the authentication. If it fails your xmpp domain is wrong.
Please post your complete XML logs, then we can check.

Alex
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: