In our application, we are using a socket for the core feature of our application, and we need to make sure that the socket is connected to low-bandwidth internet as well.
So, I make my network speed Edge (from Network Conditioner in the Developer Mode option on iPhone). Now, I am receiving approx 230 to 250Kpbs speed on my device. Now, when I tried to connect the socket in this condition it took sometimes 5 seconds even sometimes 10 seconds. Here is my connection code.
public func connect() {
if socket == nil {
socket = self.manager.socket(forNamespace: CallSocketHandlerConstants.nameSpace.rawValue)
self.observeSocketMsgEvents()
self.observeSocketClientEvents()
}
if socket?.status != .connected || socket?.status != .connecting {
socket?.connect()
}
}
In our application, we are using a socket for the core feature of our application, and we need to make sure that the socket is connected to low-bandwidth internet as well. So, I make my network speed Edge (from Network Conditioner in the Developer Mode option on iPhone). Now, I am receiving approx 230 to 250Kpbs speed on my device. Now, when I tried to connect the socket in this condition it took sometimes 5 seconds even sometimes 10 seconds. Here is my connection code.
And the reconnection code:
Also, we are facing some weird issues, sometimes socket layer got disconnected but the socket manager is connected internally and vice vera.
Any solutions?