小编Dvl*_*lpr的帖子

在Ubuntu上为WebRTC安装TURN服务器

如何在我的ubuntu 12.04上安装TURN服务器?你能分享教程吗?我读了这篇教程:为WebRTC应用程序实现我们自己的STUN/TURN服务器.但我不明白的是如何在我的ubuntu 12.04上安装自己的TURN服务器?

我正在使用类似以下代码的东西来创建 RTCPeerConnection

const pc_config = {"iceServers": [{"url": "stun:stun.l.google.com:19302"},
  {"url":"turn:my_username@<turn_server_ip_address>", "credential":"my_password"}]};

const pc_new = new webkitRTCPeerConnection(pc_config);
Run Code Online (Sandbox Code Playgroud)

我想填写上面代码的参数来使用不同的网络.

当我想安装转服务器然后我得到

Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package resiprocate-turn-server
Run Code Online (Sandbox Code Playgroud)

我用过apt-get install resiprocate-turn-server.我还使用了这个https://www.webrtc-experiment.com/docs/TURN-server-installation-guide.html教程.

video-streaming html5-video webrtc rfc5766turnserver coturn

9
推荐指数
3
解决办法
2万
查看次数

将 Dictionary&lt;int, List&lt;string&gt;&gt; 分配给空的新声明字典

我有一本字典,如下所示:

var objListColor = new List<String>() { "Red", "Blue", "Green", "Yellow" };
var objListDirection = new List<String>() { "East", "West", "North", "South" };

var dictFrom = new Dictionary<int, List<String>>();
dictFrom.Add(1, objListColor);
dictFrom.Add(2, objListDirection);
Run Code Online (Sandbox Code Playgroud)

我有另一个字典声明,如下所示:

var dictTo = new Dictionary<int, List<String>>();
Run Code Online (Sandbox Code Playgroud)

我想填充dictTodictFrom键和值。如何使用 LINQ 或 C# 进行填充?我想用 foreach 或 for 循环分配值和键。

.net c# dictionary list

3
推荐指数
1
解决办法
2424
查看次数

将字典添加到字典列表

我有如下代码:

static void Main(string[] args)
{
    List<Dictionary<string, string>> abc = new List<Dictionary<string, string>>();

    Dictionary<string, string> xyz = new Dictionary<string, string>();
    Dictionary<string, string> klm = new Dictionary<string, string>();

    xyz.Add("xyz_1", "4");
    xyz.Add("xyz_2", "5");

    klm.Add("klm_1", "9");
    klm.Add("klm_2", "8");

    abc.Add(xyz);
    xyz.Clear();
    /*after this code xyz clear in my abc list. Why ?*/
    abc.Add(klm);
}
Run Code Online (Sandbox Code Playgroud)

我创建字典列表。然后,我将字典添加到此列表中。但是添加字典后,具有清除功能的字典将为空,而不是从列表中删除。通常,我的“ abc”列表应包含xyz和klm字典及其值。但是运行clearfunction时xyz值计数将为0。我该如何预防该站?

c# dictionary list add

0
推荐指数
1
解决办法
5925
查看次数