What is the reason for SocketException ssq.eu.amity.co

I have the following exceptions every few hours.
What is the reason?
How can I handle, catch or stop it?
They do not create crashes.
They are logged by Sentry.

SocketException ssq.eu.amity.co
SocketException: Bad file descriptor (OS Error: Bad file descriptor, errno = 9), address = ssq.eu.amity.co, port = 59056

SocketException ssq.eu.amity.co
SocketException: Can't assign requested address (OS Error: Can't assign requested address, errno = 49), address = ssq.eu.amity.co, port = 58913

SocketException socket_patch.dart in _NativeSocket.write
SocketException: Write failed (OS Error: Broken pipe, errno = 32), address = ssq.eu.amity.co, port = 58558

SocketException *ssq.eu.amity.co
SocketException: Software caused connection abort (OS Error: Software caused connection abort, errno = 103), address = ssq.eu.amity.co, port = 39418

1 Like

Hello @meridork, could you please provide additional details regarding the specific stage or function where these exceptions are occurring? If you can share a sequence of steps leading up to these exceptions, it would enable us to provide more efficient and accurate answers.

Also, have you managed to get the debugging tool that can provide logs from the iOS side?

I don’t know more information about the exception.
I’m using sentry_flutter to collect those exception.
The exceptions are not in my flutter code and they sent directly to Sentry.
I can invite you the my project in Sentry, please send me the eMail

Thank you for confirming. We have forwarded this to our team for a primary review to determine if we can offer more detailed answers, as the current information we received is limited. We will notify you if access to Sentry is required.

Good morning @meridork, we apologize for the error you’re encountering. We’ll do our best to resolve it.

Please allow me to gather more information to better understand the situation, Is this error logged by Sentry without causing any application crashes?

In The last week I don’t have iOS crashes but I have those exceptions

Thank you very much. I just wanted to clarify that these errors do not cause any crashes. The errors related to the socket connection could occur, but we have automatic socket reconnection logic in place.

Have there been any reports indicating whether these errors impact the functionality of your application?

Good you reconnect automatically
When I’m running my App I don’t see problems
Is it possible to add exception handler to prevent the report to Sentry

Hello @meridork.
Unfortunately, it is not possible to hide the exception for now. However, we will explore the options and will keep you posted.

1 Like

The SocketException exceptions that you are seeing are caused by a variety of issues, including:

  • Bad file descriptor: This exception can occur when the socket descriptor is no longer valid. This can happen if the socket has been closed or if the underlying file descriptor has been closed.
  • Can’t assign requested address: This exception can occur when the application tries to bind a socket to a port that is already in use.
  • Write failed: This exception can occur when the application tries to write data to a socket that is not connected or that has been closed.
  • Software caused connection abort: This exception can occur when the remote host terminates the connection. This can happen for a variety of reasons, such as a network error, a timeout, or a bug in the remote host software.

To handle, catch, or stop these exceptions, you can use the following strategies:

  • Wrap your socket code in a try/catch block. This will allow you to catch the exceptions and handle them appropriately.
  • Use a socket pool. A socket pool is a collection of pre-allocated sockets. This can help to improve performance and reduce the likelihood of SocketException exceptions.
  • Use a timeout. If your application is waiting for a response from a remote host, you can use a timeout to ensure that the application does not block indefinitely.
  • Check the return value of socket operations. Many socket operations return a status code. You can check the status code to determine if the operation was successful.

Thanks, you are right.
But the socket_io_client, code is on of Amity Dependencies.
How can I do it?