第78篇一对多之稳定性研究(三)及array_walk及array_values

关键词:一对多稳定性研究, array_walk,array_values

一、一对多稳定性研究

1.1 测试平台--本地服务器运行平台

老师端:带老师名字

https://localhost:9101/demos/index.html?roomid=888&t=600&&teaNameMobile=莫言

学生一:

https://localhost:9101/demos/student.html?studentId=1001&stuNameMobile=张三丰&t=600#888

学生二:带学生中文名字  

https://localhost:9101/demos/student.html?studentId=1002&stuNameMobile=白子画&t=600#888

学生三:带学生英文名字

https://localhost:9101/demos/student.html?studentId=1003&stuNameMobile=司马南&t=600#888

1.2 bug处理

1)错误描述如下:

setLocalDescription error DOMException: Failed to set local answer sdp:Called in wrong state: STATE_INPROGRESS

2代码分析-----------------RTCMultiConnection.js

分析下这个函数:

        function i(n) {

            d[n](function(n) {

                n.sdp =r.processSdp(n.sdp), d.setLocalDescription(n, function() {

                    r.trickleIce&& (e.onLocalSdp({

                        type:n.type,

                        sdp:n.sdp,

                       remotePeerSdpConstraints: e.remotePeerSdpConstraints || !1,

                       renegotiatingPeer: !!e.renegotiatingPeer || !1,

                        connectionDescription:s.connectionDescription,

                       dontGetRemoteStream: !!e.dontGetRemoteStream,

                        extra: r ?r.extra : {},

                       streamsToShare: w,

                        isFirefoxOffered:U

                    }),r.onSettingLocalDescription(s))

                }, function(e) {

                    r.enableLogs&& console.error("setLocalDescription error", e)

                })

            }, function(e) {

                r.enableLogs&& console.error("sdp-error", e)

            }, j.sdpConstraints)

        }

二、php

2.1PHP array_values() 函数

1)定义和用法

array_values() 函数返回包含数组中所有的值的数组。

提示:被返回的数组将使用数值键,从 0 开始且以 1 递增。

2)语法

array_values(array)

3)看个例子

注:这个函数没什么意思,就是获取一个数组的所有键值。

2.2 PHP array_walk() 函数

1定义和用法

array_walk() 函数对数组中的每个元素应用用户自定义函数。在函数中,数组的键名和键值是参数。

注释:您可以通过把用户自定义函数中的第一个参数指定为引用:&$value,来改变数组元素的值(参见实例 2)。

提示:如需操作更深的数组(一个数组中包含另一个数组),请使用 array_walk_recursive() 函数。

2语法

array_walk(array,myfunction,parameter...)

3看个例子如下

a.)例子一如下:

带有一个参数:

注:$key指键名

$p指:has the value

$value:指键值。

b.)例子二如下:

改变数组元素的值(请注意 &$value):

注:把值全改变yellow.

c.)例子三如下:

对数组中的每个元素应用用户自定义函数:

注:这个例子和例子一是一样的。

2017年3月19日星期日

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值