-
Notifications
You must be signed in to change notification settings - Fork 73
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
Add ice trickle support on wasm #16
Conversation
I tried with chrome <-> native, and there I do get a log message saying it's connected (!), and the demo game starts, though I don't get any data. It just seems to freeze and I get some warnings about unsupported extensions on the native side. Firefox <-> native never changes to connected. |
@sapir I don't suppose you have any hunches as to what might be wrong? |
to be honest, my own pr was the result of my staring at the (working) webrtc offer/answer example and comparing with your (practically identical) code and wondering what the difference was. I'll try to take a look later, though. |
What I've found so far:
|
For me neither actually. It seems my last commit, the one that sets negotiated to false on wasm was the one that broke it. The commit before that works for me, though (even with the dropped trickle future).
Yeah, that seems like a good idea to check! |
Just noting down my progress as I have to put this down for now, and I'm not sure when I get a chance to pick it up again.
I tried this now, and the good news is that I actually get some data coming through cross-platform now! The bad news is performance is horrible even on wasm <-> wasm, and sometimes the outgoing message buffer just fills up. Need to look this over and see if I made a mistake somewhere. One thing that's different is that the trickle future is dropped as soon as the data channel is ready... So maybe it chooses some poor ice candidate instead of the optimal one? Guess I should read up on how ice trickle actually works. Does it "upgrade" the connection if it gets a "better" candidate? I should probably check the webrtc connection inspection tab in browser and compare against the working version and see if/what the difference is. Another thing to do is add onerror/onclose callbacks and log there so we can better see what happens. |
Following the same pattern as the native implementation. Now that both wasm and native support trickling, we're one step closer to supporting cross-platform connections. Issue: #7
Also set it explicitly on native
16b0fde
to
aebcffc
Compare
Rebased and fixed conflicts. |
I took a stab at this again today. First, I updated to webrtc-rs 0.5 for the native side, that broke connections with negotiated set to true, so I disabled it on both the wasm and native side. ...and was able to get cross-play between chrome and native working smoothly! as well as chrome-chrome. Sadly, firefox is giving me all sorts of grief. After connecting firefox-firefox, framerate for the bevy app drops to about 0.7, which I think makes ggrs just freeze indefinitely, so something really horrible is happening there. Connecting firefox to chrome or native give similar horrible results. I pushed my work today to the It would probably also be interesting to see if the behavior is the same on linux and on other machines. And testing firefox-firefox across the network instead of just locally. |
Inspecting this more closely, we used to use the API incorrectly, so pretty sure we have never used negotiated channels in the native implementation. |
Fixed in #54 instead |
Following the same pattern as the native implementation. Now that both
wasm and native support trickling, we're one step closer to supporting
cross-platform connections.
TODO:
Issue: #7