You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Server not responding after getting to background and back
No error event triggered
Steps to reproduce
I have basic server configuration (simple http server). It works perfect while on foreground. If go background, it will stop responding after several seconds. It will not go back nor emit error or close event.
Options:
{port: 3032,host: '0.0.0.0',reuseAddress: true,}
Current behavior
As described above.
Expected behavior
I assume that error should be triggered as a clou to restart listening.
Screenshots
If applicable, add screenshots to help explain your problem.
Relevant information
OS
13.3
react-native
0.62.2
react-native-tcp-socket
4.2.0
The text was updated successfully, but these errors were encountered:
kelcon
changed the title
Server not responding after getting to background and back. No error event triggered
iOS: Server not responding after getting to background and back. No error event triggered
Jul 9, 2020
@kelcon, sorry you have that issue. Sadly, iOS closes all TCP connections after a short period of time after the app has been sent to the background.
However, you can use a background service React Native library to keep your app running in the background with all sockets open. I created react-native-background-actions, but there are a lot of similar libraries.
Thank you. I will check it. I have discovered other approach in the mean time - to listen for an app state change and respawn server after "active" state event.
Description
Server not responding after getting to background and back
No error event triggered
Steps to reproduce
I have basic server configuration (simple http server). It works perfect while on foreground. If go background, it will stop responding after several seconds. It will not go back nor emit error or close event.
Options:
Current behavior
As described above.
Expected behavior
I assume that error should be triggered as a clou to restart listening.
Screenshots
If applicable, add screenshots to help explain your problem.
Relevant information
The text was updated successfully, but these errors were encountered: