Open jahanzaib5244 opened 7 months ago
The error you are receieving (pong reply not received from server
) would indicate that the client has been unable to check in with the server and so has terminated the connection. This would normally be expected when the network conditions have degraded, and certainly wouldn't be expected with as much frequency as you are experiencing.
It could be that there is a a proxy, or other network device, that is closing the connection uncleanly. Often this is because such devices detect the connection as being idle. If this is the case you can use the https://github.com/pusher/pusher-websocket-react-native?tab=readme-ov-file#activitytimeout-double option to ensure the connection is active. As you are experiencing the disconnection after 30-40 seconds it may be prudent to try a value of 20 seconds and see if this resolves the issue.
The error you are receieving (
pong reply not received from server
) would indicate that the client has been unable to check in with the server and so has terminated the connection. This would normally be expected when the network conditions have degraded, and certainly wouldn't be expected with as much frequency as you are experiencing. It could be that there is a a proxy, or other network device, that is closing the connection uncleanly. Often this is because such devices detect the connection as being idle. If this is the case you can use the https://github.com/pusher/pusher-websocket-react-native?tab=readme-ov-file#activitytimeout-double option to ensure the connection is active. As you are experiencing the disconnection after 30-40 seconds it may be prudent to try a value of 20 seconds and see if this resolves the issue.
thank you for your response let me check if is it working in my case or not.
I am using two different simulators at the same time once the pusher is initialized and subscribe to a private channel it works perfectly but after one minute or more it stops listing without any trigger and sometimes I get an error and after some time it auto-reconnect what causes the problem and how I can resolve this
onError: Pong reply not received code: 4201 exception: <PusherSwift.PusherError: 0x600000d73db0>
first, it will work perfectly and after 30 or 40 seconds it stops listing for new events and does not give any state change event
but after some time I got a new console like
it automatically connects and disconnect again and again until I reset pusher
Here is my configuration code for the pusher
@pusher/pusher-websocket-react-native": "^1.3.0" react native : "0.72.5" x code Version 15.2