Not logged in. · Lost password · Registration disabled
Forum: MatriX and XmppDotNet RSS
Exception thrown: DotNetty.Transport.Channels.ClosedChannelException: 'I/O error occurred.'
najeeb #1
Subject: ClosedChannelException
My project type is Xamarin (Framework: .NET Standard 2.0). I need to have XMPP functionality and for this I am using the Matrix vNext library. I have already deployed ejabberd on an AWS (Ubuntu) instance. I have used independent chat clients like Pandion, Pidgin, and so on, and they're all logging in to my server fine.

When I try to log in using the same credentials like so:
  1.             XmppClient _xmppClient = new XmppClient {
  2.                 Username = "user_id",
  3.                 Password = "password",
  4.                 XmppDomain = "example.com",
  5.                 Resource = "my_res",
  6.                 Port = 5222,
  7.                 HostnameResolver = new SrvNameResolver (),
  8.                 CertificateValidator = new AlwaysAcceptCertificateValidator (),
  9.             };
  10.  
  11.             // Handlers for presence and messages here
  12.  
  13.             await _xmppClient.ConnectAsync ();
  14.             await _xmppClient.SendPresenceAsync (Show.Chat, "READY");

I get the following exception:

DotNetty.Transport.Channels.ClosedChannelException: 'I/O error occurred.'

Any help will be appreciated. Thanks.
This post was edited on 2020-01-22, 10:38 by Alex.
Avatar
Alex #2
Please post your complete XML logs.
Also please take a look at this thread, I assume its the same issue:
https://forum.ag-software.net/thread/2147-Matrix-vNext-in-…
najeeb #3
Yes Alex, I already did. I implemented the solution. Seems to be working now. Thanks for this.
najeeb #4
Works like a breeze, Alex. Thanks for this!
Avatar
Alex #5
great, looks like we should add it to the docs and maybe create a nuget package or code repository with a patched TLS handler for Xamarin.
If you have code feel free to share here with others that may run into similar issues.

Alex
najeeb #6
Sure Alex, will do that.