Start a conversation

Why do I receive the error, "Socket closed by remote peer."?

QBChat/didDisconnect, error: Error Domain=GCDAsyncSocketErrorDomain Code=7 "Socket closed by remote peer" UserInfo=0x10e58040 {NSLocalizedDescription=Socket closed by remote peer}, 

There are several reasons why you receive this error message and your application becomes disconnected, for example, Internet connection is lost, your application goes to background mode or terminated state, call is ended but an application still tries to connect to the closed remote peer.

Your application should perform a reconnection when this occurs unintendedly. There are several ways to do this. For instance, you can make a silent reconnect, without needing to show a login screen - just save the user’s credentials in your app and reconnect or you can ask a user to log into their account again but in both cases you need to use reconnection logic described in our documentation.

The implementation of reconnection logic is very similar to the implementation of connection logic. We outline this in more detail in our documentation.

For more details please check our official documentation for each SDK:

iOS SDK - Connection | Chat | iOS SDK | QuickBlox

Android SDK - Connection | Chat | Android SDK | QuickBlox

JavaScript SDK - Connection | Chat | JavaScript SDK | QuickBlox

React Native SDK - Connection | Chat | React Native SDK | QuickBlox

Flutter SDK - Connection | Chat | Flutter SDK | QuickBlox

Feel free to check our official documentation for more information that will help you to integrate QuickBlox services into your applications / projects or contact our Support team by submitting a ticket if you have any other questions.

Choose files or drag and drop files
Was this article helpful?
  1. Maksym Pidhorbunskyi

  2. Posted
  3. Updated