hosseinmd / react-signalr

MIT License
43 stars 14 forks source link

stop and reconnect method #35

Closed fukemy closed 11 months ago

fukemy commented 11 months ago

Hi, thanks you for great library, It's work normally after 1 year used in production mode. Now I have a problem like this:

When using signalr, when app go to background, the system will kill app so fast, so when open app again, the app re-lauched from initialize state, in this case + calling = I have a trouble in call.

So now, I want to ask the function stop and reconect/connect again when app go to background/active to handle this case. Thanks so much.

hosseinmd commented 11 months ago

Hi I need to clarify "+ calling" and realize what is the meaning. Is it mean you are trying to send an event? For doing something like that, you should wait until connected to the server. I can add something to do it in background.

fukemy commented 11 months ago

hi, sory for less information. my case like below: I am using WebRTC for calling, when app active, all work good. but in case app in background while calling, the system kill app faster than other calling app, when open app again, the app start from initiately state.

I tried to test calling app without Signalr, and it work normally in case app in background.

So, I think it will better if we have pause/reconnect method. it will help me a lots to solve this problem

fukemy commented 11 months ago

or if you have better solutions, please guide me, thank you so much

hosseinmd commented 11 months ago

It is not clear to me is WebRTC re mounting React components if you back from background to foreground?

hosseinmd commented 11 months ago

Connection and Reconnection is happening on react useEffect so it depends on react behavior to how reconnecting

fukemy commented 11 months ago

It's my bad, the app got killed due to over CPU when using WebRTC calling, not by signalr, thanks