Not logged in. · Lost password · Register
Forum: MatriX and XmppDotNet RSS
Exception thrown: DotNetty.Transport.Channels.ClosedChannelException: 'I/O error occurred.'
najeeb #1
Member since Jan 2020 · 4 posts
Group memberships: Members
Show profile · Link to this post
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, 11:38 by Alex.
Avatar
Alex #2
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
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
Member since Jan 2020 · 4 posts
Group memberships: Members
Show profile · Link to this post
Yes Alex, I already did. I implemented the solution. Seems to be working now. Thanks for this.
najeeb #4
Member since Jan 2020 · 4 posts
Group memberships: Members
Show profile · Link to this post
Works like a breeze, Alex. Thanks for this!
Avatar
Alex #5
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
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
Member since Jan 2020 · 4 posts
Group memberships: Members
Show profile · Link to this post
Sure Alex, will do that.
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: