仅使用 WebRTC 发送优惠 [英] Send offers with WebRTC only

查看:19
本文介绍了仅使用 WebRTC 发送优惠的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建类似聊天轮盘赌的东西:有两个同行.两个对等方都向信令服务器发送 SDP 提议,要求它与某人建立联系.信令服务器使用对等方 A 的提议将其作为对等方 B 的答复发送,反之亦然.

I want to create something similar like chat roulette: There are two peers. Both peers send an SDP offer to the signaling server asking it to get connected with someone. The signaling server uses the offer of peer A to send it as an answer to peer B and vice versa.

两个对等点都可以在不使用 createAnswer() 的情况下 setLocalDescription() 和 setRemoteDescription().

Both peers could setLocalDescription() and setRemoteDescription() without using createAnswer().

他们现在可以进行下一步并交换候选人吗?或者是否有必要至少发送一个使用 createAnswer() 创建的真实答案?

Could they now go to the next step and exchange candidates? Or is it necessary that at least one is sending a real answer created with createAnswer()?

推荐答案

没有.报价不是答案.一个答案建立在一个提议之上,它​​是一个改进,一个迭代,一个谈判.

No. An offer is not an answer. An answer builds on an offer, it's a refinement, an iteration on it, a negotiation.

offer-answer 交换本质上是不对称的,因此您的同行将处于不兼容的状态 说明他们是否都发出了报价.

The offer-answer exchange is inherently asymmetric, so your peers will be in incompatible states if they've both sent out offers.

相反,先解决 A 和 B 的发现(配对),然后从 A 到 B 进行 WebRTC.

Instead, solve discovery (pairing) of A and B first, then do WebRTC from A to B.

这篇关于仅使用 WebRTC 发送优惠的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆