Subject: Xamarin iOS disconnections
Hi,
I've been having a lot of disconnections with production users.
I was able to get the socket exception from those users. Maybe you can help me just understand what we could do on the client side to avoid those issues?
Here's the list:
1) I'm handling this one by deleting and reopening the matrix client.
2) Sometimes the connection closes and we only get the error (using all event handlers for errors) after the user try to send a chat message (or presence)
Matrix.XmppStreamExceptionUnable to send data. The XMPP Stream is inactive
3) I'm verifying if what I'm sending is null before sending. Still I'm getting this:
System.NullReferenceExceptionObject reference not set to an instance of an object
Raw
Matrix.Net.ClientSocket.Send(byte[] bData)
4) Another one that is kinda like the 1st. Handling by reconnecting.
5) Really don't know why this happens to some users only, handling by reconnecting:
System.IO.IOExceptionThe authentication or decryption has failed.
Raw
This is the assembly info for the Matrix Library that I'm using:
I'm using the library and all the code is being called in the PCL project.
Thanks!
I've been having a lot of disconnections with production users.
I was able to get the socket exception from those users. Maybe you can help me just understand what we could do on the client side to avoid those issues?
Here's the list:
1) I'm handling this one by deleting and reopening the matrix client.
System.ObjectDisposedExceptionCannot access a disposed object. Object name: 'System.Net.Sockets.Socket'.
System.Net.Sockets.Socket.ThrowIfDisposedAndClosed()
System.Net.Sockets.Socket.EndSend(IAsyncResult asyncResult, ref SocketError errorCode)
System.Net.Sockets.Socket.EndSend(IAsyncResult result)
System.Net.Sockets.NetworkStream.EndWrite(IAsyncResult ar)
System.Net.Sockets.Socket.ThrowIfDisposedAndClosed()
System.Net.Sockets.Socket.EndSend(IAsyncResult asyncResult, ref SocketError errorCode)
System.Net.Sockets.Socket.EndSend(IAsyncResult result)
System.Net.Sockets.NetworkStream.EndWrite(IAsyncResult ar)
2) Sometimes the connection closes and we only get the error (using all event handlers for errors) after the user try to send a chat message (or presence)
Matrix.XmppStreamExceptionUnable to send data. The XMPP Stream is inactive
3) I'm verifying if what I'm sending is null before sending. Still I'm getting this:
System.NullReferenceExceptionObject reference not set to an instance of an object
Raw
Matrix.Net.ClientSocket.Send(byte[] bData)
4) Another one that is kinda like the 1st. Handling by reconnecting.
Matrix.Net.SynchronousConnectExceptionClientSocket Connection request failed.
System.ObjectDisposedExceptionCannot access a disposed object. Object name: 'System.Net.Sockets.Socket'.
System.Net.Sockets.Socket.ThrowIfDisposedAndClosed()
System.Net.Sockets.Socket.EndConnect(IAsyncResult result)
Matrix.Net.ClientSocket.EndConnect(IAsyncResult ar)
System.ObjectDisposedExceptionCannot access a disposed object. Object name: 'System.Net.Sockets.Socket'.
System.Net.Sockets.Socket.ThrowIfDisposedAndClosed()
System.Net.Sockets.Socket.EndConnect(IAsyncResult result)
Matrix.Net.ClientSocket.EndConnect(IAsyncResult ar)
5) Really don't know why this happens to some users only, handling by reconnecting:
System.IO.IOExceptionThe authentication or decryption has failed.
Raw
Mono.Security.Protocol.Tls.SslStreamBase.EndRead(IAsyncResult asyncResult)
System.Net.Security.SslStream.EndAuthenticateAsClient(IAsyncResult asyncResult)
System.Net.Security.SslStream.AuthenticateAsClient(string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
Matrix.Net.ClientSocket.DoStartSecurityLayer(SslProtocols protocol)
System.IO.IOExceptionThe authentication or decryption has failed.
Mono.Security.Protocol.Tls.SslClientStream.EndNegotiateHandshake(IAsyncResult result)
Mono.Security.Protocol.Tls.SslStreamBase.AsyncHandshakeCallback(IAsyncResult asyncResult)
Mono.Security.Protocol.Tls.TlsExceptionThe server stopped the handshake.
Mono.Security.Protocol.Tls.SslClientStream.SafeEndReceiveRecord(IAsyncResult ar, bool ignoreEmpty)
Mono.Security.Protocol.Tls.SslClientStream.NegotiateAsyncWorker(IAsyncResult result)
Properties & Custom Values
Alert
Format{
"Level": "Fatal",
"Description": "HandshakeFailiure",
"IsWarning": false,
"IsCloseNotify": false,
"getType": "Mono.Security.Protocol.Tls.Alert"
}
HResult
-2146233088
System.Net.Security.SslStream.EndAuthenticateAsClient(IAsyncResult asyncResult)
System.Net.Security.SslStream.AuthenticateAsClient(string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
Matrix.Net.ClientSocket.DoStartSecurityLayer(SslProtocols protocol)
System.IO.IOExceptionThe authentication or decryption has failed.
Mono.Security.Protocol.Tls.SslClientStream.EndNegotiateHandshake(IAsyncResult result)
Mono.Security.Protocol.Tls.SslStreamBase.AsyncHandshakeCallback(IAsyncResult asyncResult)
Mono.Security.Protocol.Tls.TlsExceptionThe server stopped the handshake.
Mono.Security.Protocol.Tls.SslClientStream.SafeEndReceiveRecord(IAsyncResult ar, bool ignoreEmpty)
Mono.Security.Protocol.Tls.SslClientStream.NegotiateAsyncWorker(IAsyncResult result)
Properties & Custom Values
Alert
Format{
"Level": "Fatal",
"Description": "HandshakeFailiure",
"IsWarning": false,
"IsCloseNotify": false,
"getType": "Mono.Security.Protocol.Tls.Alert"
}
HResult
-2146233088
This is the assembly info for the Matrix Library that I'm using:
- [assembly: AssemblyVersion("1.6.0.6")]
- [assembly: AssemblyDate("20150123")]
- [assembly: AssemblyCompany("AG-Software")]
- [assembly: AssemblyConfiguration("")]
- [assembly: AssemblyCopyright("Copyright © 2008-2015")]
- [assembly: AssemblyDescription("MatriX XMPP library")]
- [assembly: AssemblyFileVersion("1.6.0.6")]
- [assembly: AssemblyProduct("MatriX")]
- [assembly: AssemblyTitle("MatriX")]
- [assembly: AssemblyTrademark("")]
- [assembly: CompilationRelaxations(8)]
- [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
- [assembly: ComVisible(false)]
- [assembly: Guid("032c2743-60f9-4113-8972-9565cf3dcf21")]
I'm using the library and all the code is being called in the PCL project.
Thanks!
This post was edited on 2016-02-07, 17:55 by Alex.