Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disconnecting when going to a new browser Tab after some time. #390

Closed
Therealjosephchrzempiec opened this issue Jan 22, 2023 · 13 comments
Closed
Labels

Comments

@Therealjosephchrzempiec

Hello, I'm noticing if I go to a new tab on the browser after some time it seems that the networked-aframe disconnects me. I can still move around the scene but I'm not connected to the server. Is there a way to stop that and still remain connected?

Joseph

@vincentfretin
Copy link
Member

Hello, is this related to #386 issue?
Please be more specific, where your experience is hosted, which adapter you're using, do you see errors in the console? Can you define "after some time"? Is this seconds, minutes, hours?
There is probably an issue in the easyrtc adapter, the websocket or a WebRTC connection close.
First can you confirm if you reproduce the issue with wseasyrtc or not? So we will be sure if the issue is with the websocket connection or the WebRTC connections.

I have a separate issue with the janus adapter, it works too well, the user stay connected forever, I need to implement kicking the user if it stays idle for like 6h lol.

@vincentfretin
Copy link
Member

Can you please make a screenshot of the web console when it happens, thanks.

@Therealjosephchrzempiec
Copy link
Author

Therealjosephchrzempiec commented Jan 22, 2023

i'm sorry this is. The other one is closed and I couldn't add to it. Or can I sense it is closed?

userdisconnect

@vincentfretin
Copy link
Member

The other issue is still open.
Ok so the datachannel is closing, no error. What time did you have to wait exactly?
And if you use adapter:wseasyrtc on networked-scene, do you have the issue too?

@Therealjosephchrzempiec
Copy link
Author

Therealjosephchrzempiec commented Jan 22, 2023

To be honest I wasn't keeping track of the time. maybe after 10 minutes or more.But I need to try it again to see.

Do you want to close the other post out or delete it?

@Therealjosephchrzempiec
Copy link
Author

Hello, I'm using all defsult settings and code from what was downloaded and installed from network-aframe. Nothing changed. I only have npm, nodejs and git downloaded nothing else.

@vincentfretin
Copy link
Member

From the screenshot you gave with the datachannels logs, it seems you use the easyrtc adapter.
To help debugging the issue, can you please test if you reproduce the issue with adapter: wseasyrtc in networked-scene=, that's it the examples/basic.html example instead of examples/basic-audio.html which use the adapter: easyrtc adapter by default.
From your comment in the previous issue, you're hosting it on your ubuntu machine and I'm assuming you git cloned the networked-aframe repo and run one of the example with npm run dev or npm start and that's not hosted on free glitch where the server may shut down for inactivity I think. Is that right?
Do you use chrome on the ubuntu machine or another OS?

I launched the basic-audio example both on firefox and chrome on a backgrounded tab with mic active on both on my ubuntu 22.04 machine where I configured a certificate in server/easyrtc-server.js to have https and I don't reproduce the issue, after 10min I wasn't disconnected. I see stillAlive messages for both browsers on a regular basis.
Do you do steps that are different than mine?

@vincentfretin
Copy link
Member

I still ran it with mic muted for another 30min, I'm still connected.

@Therealjosephchrzempiec
Copy link
Author

Therealjosephchrzempiec commented Jan 23, 2023

I'll try with the basic.html one and seee if that happens. So I need to change it from wseasyrtc to easyrtc?

@Therealjosephchrzempiec
Copy link
Author

Just an update. Changing from wseasyrtc to easyrtc in adapter: easyrtc; work. I'm still connected. thank you.

@vincentfretin
Copy link
Member

Ah so you were testing nametag example previously that used adapter: wseasyrtc I didn't pay attention this one used wseasyrtc.
The logs are misleading, with "Opening datachannel to xyz", I thought it was WebRTC datachannel so using the easyrtc adapter, but no it used wseasyrtc adapter actually, just sending the data through the websocket.
So there is indeed an issue with wseasyrtc, stillAlive messages stops being sent at one point and the connection close.
Using the easyrtc adapter will create a WebRTC connection between participants, having that the user will stay connected.
You can reproduce the problem even with easyrtc adapter if you are alone in the room.
stillAlive message stops after the fifth, every stillAlive message are sent every 20s, so you are disconnected after 120s.
It happens only on Chrome, I don't reproduce it on Firefox. I guess it's a browser specific behavior and not an issue in the library.

@Therealjosephchrzempiec
Copy link
Author

Hello vincet, that worked. I'm able to stayalive with no problems now. Thank you, I have one question what is the difference between wseasyrtc and easyrtc?

@vincentfretin
Copy link
Member

vincentfretin commented Jan 28, 2023

wseasyrtc is websocket only, data goes through websocket, no audio/video, easyrtc supports audio/video via WebRTC, data goes through WebRTC datachannel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants