text:
网速很快的情况下TCP可达50Mb（即5.2MB字节）但是KCP速度跟不上。

本机发送的最高速度只能达到17MB（约120Mb左右的速度）。
试过很过参数也不知道怎么把速度提升。
在网络速度不快的互联网，网速在10Mb即1.2MB字节左右的时候，基本上速度都和TCP差不多，比TCP慢一些，KCP在50Mb-100Mb和TCP差距很大，只有一半的样子甚至不到一半的样子。
我们主要用来发送和接收大文件用。
发送和接收的缓存，我设置成2048了，网络的RTT=17-35。
是不是可以将滑动窗口设置一下？但是不知道怎么设置。
const IUINT32 IKCP_CMD_PUSH = 81;		// cmd: push data
const IUINT32 IKCP_CMD_ACK  = 82;		// cmd: ack
const IUINT32 IKCP_CMD_WASK = 83;		// cmd: window probe (ask)
const IUINT32 IKCP_CMD_WINS = 84;		// cmd: window size (tell)
这地方是不是可以设置？有的修改后发现不能运行挂了，不知道作用是什么。
不知道哪里可以设置，该设置的参数都设置了。。。
请帮帮忙，感谢！！！

不要改这些 const，这些是命令编号，改了当然挂

@skywind3000 ，感谢您的解释，我终于明白了这个地方不能修改。
很奇怪KCP本地的速度也不高，本地发送和接收速度最高只有20MB（接近）。
要把发送和接收的缓存修改小了才行，本地发送缓存128最快。修改大了速度反而慢下来了，这个很奇怪啊。。。照理说修改大了只可能速度提升不会反而速度慢了。
HP的速度也只有这么多，HP也是一样的，128快，1024比128慢。
操作系统是windows 7   64位的专业版。
如果在互联网上，网速在10Mb以内的时候，速度和FTP差不多，稍微慢一点。
但是网速超过30Mb，50Mb的时候，就明显比FTP慢了。

参数设置： ikcp_nodelay(kcp, 1, 10, 0, 1);
MTU:1400
int ikcp_wndsize(ikcpcb *kcp, int sndwnd, int rcvwnd);分别都是2048

KCP接收和发送的缓存大于2048之后，本机发送本机接收的速度无论如何都不能超过10MB（字节），降低接收和发送的缓存之后到128，本机发送速度可以达到20MB(字节)。这个很让人搞不懂，但是也可以想象在大宽带的互联网的情况下，速度会低于FTP的情况了。

本机发送和接收达到了20MB(字节)也应该不够，我写的是每次读取2M的文件大小是64M的文件，接收是接收到缓存中不写入文件。所以只有受限于磁盘读的速度。理论上应该是达到40-70MB（字节）才是合理的。

该协议不是追求带宽利用率 KB/s，而是追求 latency，数据从一端到另外一端要多少毫秒。

@skywind3000
明白了，原理上主要就不是用来发大文件的，而是小文件或者消息快速发送。

kcp 主要用来过QoS，或者你可以理解为国际出口抢带宽。
你可以试试这个思路，再搭实验环境。再发你的试验结果来看看

@Justsoos 这个我们试过和香港的VPS连接，在10Mb（位）的速度下，和FTP差不多，有的时候比FTP高，有的时候低。但是一旦带宽很大的时候，就比FTP的速度不行了。
我们主要是用来国内传文件，试过sctp协议，在4G和wifi的情况下很糟糕，速度不是一般的慢，可能我们不会调参数吧。sctp协议也在本地速度不快。
其实很希望KCP能在本机速度快起来，也不知道是哪里的原因，可能是原理上决定了吧，但是不管怎么样我想也可以改进到本机发送接收不至于顶棚了才20MB（字节），而且是调小了接收和发送缓存（128）的情况下，如果加大发送和接收缓存（2048）则本机的速度只有10MB(字节)，这个加大缓存本机速度反而降下来很明显就有点奇怪了。

在网速快或者本机的情况下传输大文件，你轮训间隔要缩小点才行，固定10ms, 会跟不上磁盘io速度

嗯，10ms 改为 1ms，直接修改 kcp->interval = 1, kcp->minrto = 5

总之尽量模仿尽力而为的模式，如果对端接受效率高，基本上就不间断传输，如果接受方网速低，表现也就是WOULDBLOCK了，那么发送方就可以睡眠较短的时间，下次再尝试发送，最近写了个微型ftp_server，就是这种情况，当然这个ftp_server只支持下载

刚才测试过了修改
10ms 改为 1ms，直接修改 kcp->interval = 1, kcp->minrto = 5
是有提升，但是很微小。修改接收和发送的缓存大小对速度的影响最大。
128速度基本最高，然后到1024速度就明显降低了。
我们的做法是不停地向发送缓存中写入数据，每次写入102410242，就是2M
你们都试过本机发送和接收么？最高速度能达到多少？
我的是windows7 64 专业版。

我觉得如果能解决本机发送缓存的奇怪现象，那么也可以很大的提升在互联网上的速度。
照理说发送缓存应该是越大速度越快或者说不变化也是对的吧，但是在本机却明显
128的速度是1024的接近两倍速度。

我写的ftpserver, 本机传输60~70MB, 基本是磁盘io的速度，不过是标准tcp传输的，我也是2M, KCP传输，我后面写一个试试

@halx99 ,非常感谢！！！感谢您的无私帮助，如果能解决这个问题，那真的是造福很多人啊！期待您KCP本机传输结果，感谢您！！！

我说你要带宽利用率的话开5个线程tcp下载不就得了，何必跟kcp死磕 KB/s 呢？

@skywind3000 ,大哥，我是用来打洞啊NAT穿透啊，必须要用UDP啊。

能不能打洞成功后，重用端口换TCP传输？

TCP 也能打洞啊，NAT 也有 TCP 端口映射。

这个我就不清楚了，
在我的印象是UDP可以一个端口几个连接，这就是UDP非常好打洞的基础，检测了端口后，立即数据连接的端口重用。
如果是TCP，一个端口就只能一个连接，检测到了端口后，不能同时连接一旦断开下次端口就不同，那可能就不好打洞吧。
以上是我的理解，不知道对不对。
架构都已经弄好了，都不好修改了，只能想办法改进传输速度吧，也希望借这个机会能否改进一下KCP了，KCP的速度不稳，也有点奇怪的，也许是和发送缓存的那个问题有关系吧，我的直觉告诉我的。

@halx99 ,请问您的测试程序写的怎么样了？有结果了么？
感谢你即将为大家无私的付出和辛苦，谢谢。

我写的ftpserver, 本机传输60~70MB, 基本是磁盘io的速度，不过是标准tcp传输的，我也是2M, KCP传输，我后面写一个试试

你的硬盘是多少年前的呀，现在的硬盘速度基本都能达到100MB/S了吧，sata 2最大能支持300MB/S了。我2013年装的机子，普通机械硬盘，在GB级别的内网中用wget下载，硬盘IO都没达到瓶颈(120MB/S左右），你肯定不是你的ftpserver写磁盘代码有问题？

这个我就不清楚了，
在我的印象是UDP可以一个端口几个连接，这就是UDP非常好打洞的基础，检测了端口后，立即数据连接的端口重用。
如果是TCP，一个端口就只能一个连接，检测到了端口后，不能同时连接一旦断开下次端口就不同，那可能就不好打洞吧。
以上是我的理解，不知道对不对。
架构都已经弄好了，都不好修改了，只能想办法改进传输速度吧，能否改进一下KCP了，KCP的速度不稳，也有点奇怪的，也许是和发送缓存的那个问题有关系吧，我的直觉告诉我的。

kcp的设计不是以流量优先的吧，试试fastudx或vtcp，要是有时间将google的QUIC魔改下自己用。

@wineggdrop 我试过QUIC，cmake错误，windows无法生成工程编译不了，吐血啊。。。

@wineggdrop 我试过QUIC，cmake错误，windows无法生成工程编译不了，吐血啊。。。另外那两个都不是标准的开源程序，也没有太多人用，不敢用啊。

那两个是商用软件，要花钱的。vtcp旧版本是有开过源的，6.0和10.0版本。udx倒是没见过开源，但有人手里也有旧版本代码，估计是以前曾经给过人吧。这两个是很多年前就开始搞reliable udp的，我没记错是2006还是2007年时就在csdn见过他们的讨论和测试对比。加个qq讨论下？

机器很老的

这是我的硬盘拷贝速度，单个大文件

@wineggdrop 你的QQ号码是多少？
我也很少上QQ的，libquic的那个库，你能cmake出来windows版本的么？如果可以的话，我想办法尽力试试Quic。
https://github.com/devsisters/libquic
我测试的就是这个的

@wineggdrop 你的QQ号码是多少？
我也很少上QQ的，libquic的那个库，你能cmake出来windows版本的么？如果可以的话，我想办法尽力试试Quic。
https://github.com/devsisters/libquic
我测试的就是这个的，我用的是VS2013或者VS2015等都可以，只要是VS的编译器。
我使用C++开发。

qq: 504192

@wineggdrop 你的QQ号码是多少？
我也很少上QQ的，libquic的那个库，你能cmake出来windows版本的么？如果可以的话，我想办法尽力试试Quic。
https://github.com/devsisters/libquic
我测试的就是这个的，我用的是VS2013或者VS2015等都可以，只要是VS的编译器。
我使用C++开发。

我改了windows版本的libquic, 发了不少时间在公司内部使用不能开源.

@wineggdrop 你的QQ号码是多少？
我也很少上QQ的，libquic的那个库，你能cmake出来windows版本的么？如果可以的话，我想办法尽力试试Quic。
https://github.com/devsisters/libquic
我测试的就是这个的，我用的是VS2013或者VS2015等都可以，只要是VS的编译器。
我使用C++开发。

我改了windows版本的libquic, 发了不少时间在公司内部使用不能开源.

@ktprime
你试过libquic的速度怎么样？本机和网络上的速度。
能基本上满速么？
谢谢

@ktprime
你试过libquic的速度怎么样？本机和网络上的速度。
能基本上满速么？
谢谢

linux上本机ping-pong测试带宽能到50MByte/s 瓶颈在服务器和客户端单线程的cpu都跑满了. 比相同的udp测试性能差40%

@ktprime
你试过libquic的速度怎么样？本机和网络上的速度。
能基本上满速么？
谢谢

linux上本机ping-pong测试带宽能到50MByte/s 瓶颈在服务器和客户端单线程的cpu都跑满了.
从国内到印度测试, ping 58 ms
quic 带宽测试
TPS: 4902/sec, QPS:2235/sec Bytes: 22352 KB/sec, Conn: 1, rtt = 108
TPS: 5393/sec, QPS:2360/sec Bytes: 23606 KB/sec, Conn: 1, rtt = 101
TPS: 5481/sec, QPS:2358/sec Bytes: 23580 KB/sec, Conn: 1, rtt = 101
TPS: 4220/sec, QPS:2138/sec Bytes: 21380 KB/sec, Conn: 1, rtt = 111
TPS: 3852/sec, QPS:1959/sec Bytes: 19592 KB/sec, Conn: 1, rtt = 122
TPS: 4961/sec, QPS:2299/sec Bytes: 22999 KB/sec, Conn: 1, rtt = 103
TPS: 5136/sec, QPS:2275/sec Bytes: 22754 KB/sec, Conn: 1, rtt = 101
TPS: 4793/sec, QPS:2033/sec Bytes: 20329 KB/sec, Conn: 1, rtt = 121
TPS: 5367/sec, QPS:2365/sec Bytes: 23658 KB/sec, Conn: 1, rtt = 101
TPS: 3910/sec, QPS:1975/sec Bytes: 19756 KB/sec, Conn: 1, rtt = 120
TPS: 5141/sec, QPS:2364/sec Bytes: 23643 KB/sec, Conn: 1, rtt = 101
TPS: 4642/sec, QPS:1944/sec Bytes: 19442 KB/sec, Conn: 1, rtt = 123
ipef3 tcp
[ ID] Interval Transfer Bandwidth Retr Cwnd
[ 4] 0.00-1.00 sec 4.95 MBytes 41.5 Mbits/sec 0 1.87 MBytes
[ 4] 1.00-2.00 sec 13.8 MBytes 115 Mbits/sec 0 3.05 MBytes
[ 4] 2.00-3.00 sec 13.8 MBytes 115 Mbits/sec 0 3.05 MBytes
[ 4] 3.00-4.00 sec 13.8 MBytes 115 Mbits/sec 0 3.05 MBytes
[ 4] 4.00-5.00 sec 13.8 MBytes 115 Mbits/sec 0 3.05 MBytes
[ 4] 5.00-6.00 sec 13.8 MBytes 115 Mbits/sec 0 3.05 MBytes
[ 4] 6.00-7.00 sec 15.0 MBytes 126 Mbits/sec 0 3.05 MBytes
[ 4] 7.00-8.00 sec 13.8 MBytes 115 Mbits/sec 0 3.05 MBytes
[ 4] 8.00-9.00 sec 13.8 MBytes 115 Mbits/sec 0 3.05 MBytes
[ 4] 9.00-10.00 sec 13.8 MBytes 115 Mbits/sec 0 5.66 KBytes
ipef3 udp
[ ID] Interval Transfer Bandwidth Total Datagrams
[ 4] 0.00-1.00 sec 21.9 MBytes 184 Mbits/sec 2809
[ 4] 1.00-2.00 sec 23.8 MBytes 200 Mbits/sec 3052
[ 4] 2.00-3.00 sec 23.8 MBytes 200 Mbits/sec 3052
[ 4] 3.00-4.00 sec 23.8 MBytes 200 Mbits/sec 3052
[ 4] 4.00-5.00 sec 23.8 MBytes 200 Mbits/sec 3051
[ 4] 5.00-6.00 sec 23.8 MBytes 200 Mbits/sec 3052
[ 4] 6.00-7.00 sec 23.8 MBytes 200 Mbits/sec 3052
[ 4] 7.00-8.00 sec 23.8 MBytes 200 Mbits/sec 3052
[ 4] 8.00-9.00 sec 23.8 MBytes 200 Mbits/sec 3051
[ 4] 9.00-10.00 sec 23.8 MBytes 200 Mbits/sec 3052
[ 4] 0.00-10.00 sec 237 MBytes 198 Mbits/sec 0.085 ms 9/30275 (0.03%)
[ 4] Sent 30275 datagrams

本机50MB/S的速度有点慢吧。

@ktprime
你试过libquic的速度怎么样？本机和网络上的速度。
能基本上满速么？
谢谢

linux上本机ping-pong测试带宽能到50MByte/s 瓶颈在服务器和客户端单线程的cpu都跑满了.
从国内到印度测试, ping 58 ms
quic 带宽测试
TPS: 4902/sec, QPS:2235/sec Bytes: 22352 KB/sec, Conn: 1, rtt = 108
TPS: 5393/sec, QPS:2360/sec Bytes: 23606 KB/sec, Conn: 1, rtt = 101
TPS: 5481/sec, QPS:2358/sec Bytes: 23580 KB/sec, Conn: 1, rtt = 101
TPS: 4220/sec, QPS:2138/sec Bytes: 21380 KB/sec, Conn: 1, rtt = 111
TPS: 3852/sec, QPS:1959/sec Bytes: 19592 KB/sec, Conn: 1, rtt = 122
TPS: 4961/sec, QPS:2299/sec Bytes: 22999 KB/sec, Conn: 1, rtt = 103
TPS: 5136/sec, QPS:2275/sec Bytes: 22754 KB/sec, Conn: 1, rtt = 101
TPS: 4793/sec, QPS:2033/sec Bytes: 20329 KB/sec, Conn: 1, rtt = 121
TPS: 5367/sec, QPS:2365/sec Bytes: 23658 KB/sec, Conn: 1, rtt = 101
TPS: 3910/sec, QPS:1975/sec Bytes: 19756 KB/sec, Conn: 1, rtt = 120
TPS: 5141/sec, QPS:2364/sec Bytes: 23643 KB/sec, Conn: 1, rtt = 101
TPS: 4642/sec, QPS:1944/sec Bytes: 19442 KB/sec, Conn: 1, rtt = 123
ipef3 tcp
[ ID] Interval Transfer Bandwidth Retr Cwnd
[ 4] 0.00-1.00 sec 4.95 MBytes 41.5 Mbits/sec 0 1.87 MBytes
[ 4] 1.00-2.00 sec 13.8 MBytes 115 Mbits/sec 0 3.05 MBytes
[ 4] 2.00-3.00 sec 13.8 MBytes 115 Mbits/sec 0 3.05 MBytes
[ 4] 3.00-4.00 sec 13.8 MBytes 115 Mbits/sec 0 3.05 MBytes
[ 4] 4.00-5.00 sec 13.8 MBytes 115 Mbits/sec 0 3.05 MBytes
[ 4] 5.00-6.00 sec 13.8 MBytes 115 Mbits/sec 0 3.05 MBytes
[ 4] 6.00-7.00 sec 15.0 MBytes 126 Mbits/sec 0 3.05 MBytes
[ 4] 7.00-8.00 sec 13.8 MBytes 115 Mbits/sec 0 3.05 MBytes
[ 4] 8.00-9.00 sec 13.8 MBytes 115 Mbits/sec 0 3.05 MBytes
[ 4] 9.00-10.00 sec 13.8 MBytes 115 Mbits/sec 0 5.66 KBytes
ipef3 udp
[ ID] Interval Transfer Bandwidth Total Datagrams
[ 4] 0.00-1.00 sec 21.9 MBytes 184 Mbits/sec 2809
[ 4] 1.00-2.00 sec 23.8 MBytes 200 Mbits/sec 3052
[ 4] 2.00-3.00 sec 23.8 MBytes 200 Mbits/sec 3052
[ 4] 3.00-4.00 sec 23.8 MBytes 200 Mbits/sec 3052
[ 4] 4.00-5.00 sec 23.8 MBytes 200 Mbits/sec 3051
[ 4] 5.00-6.00 sec 23.8 MBytes 200 Mbits/sec 3052
[ 4] 6.00-7.00 sec 23.8 MBytes 200 Mbits/sec 3052
[ 4] 7.00-8.00 sec 23.8 MBytes 200 Mbits/sec 3052
[ 4] 8.00-9.00 sec 23.8 MBytes 200 Mbits/sec 3051
[ 4] 9.00-10.00 sec 23.8 MBytes 200 Mbits/sec 3052
[ 4] 0.00-10.00 sec 237 MBytes 198 Mbits/sec 0.085 ms 9/30275 (0.03%)
[ 4] Sent 30275 datagrams

这个到印度的速度，你测试的结果是 不可靠UDP > QUIC > TCP的吧？
这个QUIC需要调参数的吗？还是默认参数就是这个效果？
你将libquic修改支持windows花了多长时间？主要是了解工作量大不大，如果不是很大，我想试试修改支持windows。

是的, 我修改花了1个多月, quic原代码是支持各自平台我做了一层封装, quic比较消耗cpu(tcp2倍). 测试弱网环境(rtt高, 丢包率高)下比tcp好很多.
最新版本的quic从chrome代码扣出来, 工作量大得惊人,还是搞....
quic参数还是需要调整一下否则性能惨不忍睹...

外网测试基本上quic不差于udp(有丢包),
本机测试单线程的服务器和客户端跑满cpu, cpu是瓶颈或者说quic很消耗cpu
同等qps下cpu是tcp2-3倍. 弱网环境(rtt高, 丢包率高)下各自数据比tcp好很多.
修改花了1个多月移植到各自平台(win/addr/ios/linux), quic原代码本身支持多平台我做了一层封装,
最新版本的quic从chrome代码扣出来, 工作量大得惊人,还是搞....
quic参数还是需要调整一下否则性能惨不忍睹...

不差于udp是指不差于系统本身原生的udp协议(不是第三方库提供的稳定udp库）？正常丢包率的百分比大约范围是多少？本机测试用的是什么样的硬件设备(虚拟机)?

本机测试在linux(或windows)同时启动quic测试客户端和服务器不用虚拟机
udp测试使用的是iper3上测试,丢包率大小和网络环境关系比较大,有时候udp和quic同等贷款下丢包率超过10%甚至更多.
在丢包率15%的弱网环境下, quic带宽比tcp高70%, rtt小50%

本机测试在linux ubunt16.04 Intel(R) Xeon(R) CPU E5-2620 v4 @ 2.10GHz (或windows AMD R7 1700)同时启动quic测试客户端和服务器不用虚拟机
udp测试使用的是iper3工具,丢包率大小和网络环境关系比较大,udp和quic同等最大带宽下丢包率超过10%甚至更多.
在丢包率15%的弱网环境下, quic带宽比tcp高70%, rtt小50%
两边的测试方法可能不一样, 我用ping-ping循环测试, iper3不知是不是单向发包双方统计.

E5-2620 v4 虽然主频较低，但跑满cpu才上50MB/S,还真是好耗cpu。我测试的机子是E3 1230 V2,本机上260MB/S，cpu才2%-3%的样子，quic这么耗cpu,是什么缘故呢，如果只是个收发算法，没对数据进行加解密操作，不应该如此耗cpu吧

也发现一些问题, 需要调优参数
即使内网每次udp recv只能读取不超过1500字节, 过于频繁的系统调用, 之后quic后面的协议解析,加解密也非常慢. 再加上拥塞控制重传等.

也发现一些问题, 需要调优参数
即使内网每次udp recv只能读取不超过1500字节, 过于频繁的系统调用, 之后quic后面的协议解析,加解密也非常慢. 再加上拥塞控制重传等. 测试代码本身有一点逻辑, 要copy解析完整包再发往对端.
你是测试KCP 还是 裸UDP ? 用iperf3 测试cpu也不高

如果quic本身就内嵌了加解密，无法将那部份剥离掉，那cpu肯定不会低，不知道使用什么加密协议，TLS?如果能将加密协议去掉，那估计cpu占用率会大大降低吧。
我的测试不是kcp,是vtcp,一个收费的第三方库

新版quic上TLS加密, 我用的quic2年前版本是Aes加密,剥离加密算法需要一点工会,强耦合的

新版quic上TLS加密, 我用的quic2年前版本是Aes加密,剥离加密算法需要一点工会,强耦合的

剥离加密协议速度应该会杠杆的

你的库有测试丢包率15%网络环境下性能?

你的库有测试丢包率15%网络环境下性能?

我的测试多数是限制在10%上限丢包率的默认设置下测试的了，更高的丢包率也测过，如果网络环境是真差的话，10%丢包上限和20%上限，在速度上波动也是3%以内

测试机器
macOS Catalina 10.15.1 (MBP 2016)
CPU: Intel Core i7 2.9 GHz 四核八线程
内存: 16GB 2133MHz LPDDR3
硬盘: Apple SSD SM1024L
kcp 参数
"config": {
    "kcp": {
        "sndWnd": 2048,
        "rcvWnd": 2048,
        "mtu": 1920
    },
    "tunnel": {
        "buffSize": 10240
    }
}

kcp code
    ikcp_nodelay(channel->kcp, 1, 3, 2, 1);
    ikcp_wndsize(channel->kcp, config->sndWnd, config->rcvWnd);
    ikcp_setmtu(channel->kcp, config->mtu);

    channel->kcp->stream = 1;
    channel->kcp->rx_minrto = 10;

测试结果
10:01:30.420 nv_kcp_bitrate_append_bs|130:       svr.ch-w-0000     96409600    93.126mb/s
10:01:30.425 nv_kcp_bitrate_append_bs|130:       svr.ch-r-0000    104288504   100.240mb/s
10:01:31.420 nv_kcp_bitrate_append_bs|130:       svr.ch-w-0000    205271040   106.204mb/s
10:01:31.429 nv_kcp_bitrate_append_bs|130:       svr.ch-r-0000    205780400    98.718mb/s
10:01:32.423 nv_kcp_bitrate_append_bs|130:       svr.ch-w-0000    299581440    91.916mb/s
10:01:32.430 nv_kcp_bitrate_append_bs|130:       svr.ch-r-0000    299220184    91.159mb/s
10:01:33.435 nv_kcp_bitrate_append_bs|130:       svr.ch-r-0000    378657232    77.189mb/s
10:01:33.435 nv_kcp_bitrate_append_bs|130:       svr.ch-w-0000    386938880    84.298mb/s
10:01:34.440 nv_kcp_bitrate_append_bs|130:       svr.ch-r-0000    471025624    89.755mb/s
10:01:34.440 nv_kcp_bitrate_append_bs|130:       svr.ch-w-0000    476487680    87.015mb/s
10:01:35.442 nv_kcp_bitrate_append_bs|130:       svr.ch-w-0000    565626880    86.876mb/s
10:01:35.445 nv_kcp_bitrate_append_bs|130:       svr.ch-r-0000    551972416    78.578mb/s
10:01:36.449 nv_kcp_bitrate_append_bs|130:       svr.ch-r-0000    653798232    99.142mb/s
10:01:36.449 nv_kcp_bitrate_append_bs|130:       svr.ch-w-0000    669900800   101.122mb/s
10:01:37.452 nv_kcp_bitrate_append_bs|130:       svr.ch-r-0000    741262504    85.159mb/s
10:01:37.459 nv_kcp_bitrate_append_bs|130:       svr.ch-w-0000    764579840    91.545mb/s
10:01:38.454 nv_kcp_bitrate_append_bs|130:       svr.ch-r-0000    832369096    88.794mb/s
10:01:38.491 nv_kcp_bitrate_append_bs|130:       svr.ch-w-0000    867174400    97.083mb/s

测试机器
macOS Catalina 10.15.1 (MBP 2016)
CPU: Intel Core i7 2.9 GHz 四核八线程
内存: 16GB 2133MHz LPDDR3
硬盘: Apple SSD SM1024L
kcp 参数
"config": {
    "kcp": {
        "sndWnd": 2048,
        "rcvWnd": 2048,
        "mtu": 1920
    },
    "tunnel": {
        "buffSize": 10240
    }
}

kcp code
    ikcp_nodelay(channel->kcp, 1, 3, 2, 1);
    ikcp_wndsize(channel->kcp, config->sndWnd, config->rcvWnd);
    ikcp_setmtu(channel->kcp, config->mtu);

    channel->kcp->stream = 1;
    channel->kcp->rx_minrto = 10;

测试结果
10:01:30.420 nv_kcp_bitrate_append_bs|130:       svr.ch-w-0000     96409600    93.126mb/s
10:01:30.425 nv_kcp_bitrate_append_bs|130:       svr.ch-r-0000    104288504   100.240mb/s
10:01:31.420 nv_kcp_bitrate_append_bs|130:       svr.ch-w-0000    205271040   106.204mb/s
10:01:31.429 nv_kcp_bitrate_append_bs|130:       svr.ch-r-0000    205780400    98.718mb/s
10:01:32.423 nv_kcp_bitrate_append_bs|130:       svr.ch-w-0000    299581440    91.916mb/s
10:01:32.430 nv_kcp_bitrate_append_bs|130:       svr.ch-r-0000    299220184    91.159mb/s
10:01:33.435 nv_kcp_bitrate_append_bs|130:       svr.ch-r-0000    378657232    77.189mb/s
10:01:33.435 nv_kcp_bitrate_append_bs|130:       svr.ch-w-0000    386938880    84.298mb/s
10:01:34.440 nv_kcp_bitrate_append_bs|130:       svr.ch-r-0000    471025624    89.755mb/s
10:01:34.440 nv_kcp_bitrate_append_bs|130:       svr.ch-w-0000    476487680    87.015mb/s
10:01:35.442 nv_kcp_bitrate_append_bs|130:       svr.ch-w-0000    565626880    86.876mb/s
10:01:35.445 nv_kcp_bitrate_append_bs|130:       svr.ch-r-0000    551972416    78.578mb/s
10:01:36.449 nv_kcp_bitrate_append_bs|130:       svr.ch-r-0000    653798232    99.142mb/s
10:01:36.449 nv_kcp_bitrate_append_bs|130:       svr.ch-w-0000    669900800   101.122mb/s
10:01:37.452 nv_kcp_bitrate_append_bs|130:       svr.ch-r-0000    741262504    85.159mb/s
10:01:37.459 nv_kcp_bitrate_append_bs|130:       svr.ch-w-0000    764579840    91.545mb/s
10:01:38.454 nv_kcp_bitrate_append_bs|130:       svr.ch-r-0000    832369096    88.794mb/s
10:01:38.491 nv_kcp_bitrate_append_bs|130:       svr.ch-w-0000    867174400    97.083mb/s

不知道怎么给弄关闭了，重新打开一下。

测试机器: MBP
macOS Catalina 10.15.1 (MBP 2016)
CPU: Intel Core i7 2.9 GHz 四核八线程
内存: 16GB 2133MHz LPDDR3
硬盘: Apple SSD SM1024L
测试机器: arm
CPU: ARMv6-compatible processor rev 7 (v6l)
Mem: total: 44Mb; free: 25Mb
File System IO: 7.4MB/s
kcp code
    ikcp_nodelay(channel->kcp, 1, 3, 2, 1);
    ikcp_wndsize(channel->kcp, config->sndWnd, config->rcvWnd);
    ikcp_setmtu(channel->kcp, config->mtu);

    channel->kcp->stream = 1;
    channel->kcp->rx_minrto = 10;

kcp 参数
"config": {
    "kcp": {
        "sndWnd": 2048,
        "rcvWnd": 2048,
        "mtu": 1400
    },
    "tunnel": {
        "buffSize": 1350
    }
}

arm linux 测速
iperf3

server: MBP;  client: arm

Connecting to host 192.168.3.222, port 5201
[  5] local 192.168.3.81 port 33751 connected to 192.168.3.222 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.01   sec   619 KBytes  5.04 Mbits/sec    0    150 KBytes
[  5]   1.01-2.01   sec   962 KBytes  7.88 Mbits/sec    0    242 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-2.01   sec  1.54 MBytes  6.46 Mbits/sec    0             sender
[  5]   0.00-2.30   sec  1.53 MBytes  5.56 Mbits/sec                  receiver

kcp

server: MBP;  client: arm; sndWnd=rcvWnd=512

11:30:10.932 nv_kcp_bitrate_append_bs|128:       svr.ch-w-0000      1413450   786.999kb/s
11:30:11.006 nv_kcp_bitrate_append_bs|128:       svr.ch-r-0000       177478    94.908kb/s
11:30:12.251 nv_kcp_bitrate_append_bs|128:       svr.ch-r-0000       881990   565.873kb/s
11:30:12.349 nv_kcp_bitrate_append_bs|128:       svr.ch-w-0000      1529550    81.934kb/s
11:30:13.292 nv_kcp_bitrate_append_bs|128:       svr.ch-r-0000      1564486   655.616kb/s
11:30:13.559 nv_kcp_bitrate_append_bs|128:       svr.ch-w-0000      1668600   114.917kb/s
11:30:14.328 nv_kcp_bitrate_append_bs|128:       svr.ch-r-0000      1816294   243.058kb/s
11:30:14.706 nv_kcp_bitrate_append_bs|128:       svr.ch-w-0000      1722600    47.079kb/s
11:30:15.432 nv_kcp_bitrate_append_bs|128:       svr.ch-r-0000      2520806   638.145kb/s
11:30:15.757 nv_kcp_bitrate_append_bs|128:       svr.ch-w-0000      1872450   142.578kb/s
11:30:16.518 nv_kcp_bitrate_append_bs|130:       svr.ch-r-0000      3902310     1.242mb/s
11:30:17 nv_kcp_bitrate_append_bs|128:       svr.ch-r-0000      4198150   270.174kb/s
11:30:17.613 nv_kcp_bitrate_append_bs|128:       svr.ch-w-0000      1881900     5.092kb/s
11:30:18.694 nv_kcp_bitrate_append_bs|128:       svr.ch-r-0000      5215014   940.670kb/s

KCP 在 MBP 上的本机测试结果

server & client 都跑在 MPB 上, 不经过路由器, mtu 可以 > 1500

测试结果

mtu=1400,  buffSize=1350

11:03:27.719 nv_kcp_bitrate_append_bs|130:       svr.ch-w-0000     77232150    75.347mb/s
11:03:27.719 nv_kcp_bitrate_append_bs|130:       svr.ch-r-0000     62229110    60.710mb/s
11:03:28.729 nv_kcp_bitrate_append_bs|130:       svr.ch-w-0000    148529700    69.005mb/s
11:03:28.730 nv_kcp_bitrate_append_bs|130:       svr.ch-r-0000    131742998    67.213mb/s
11:03:29.734 nv_kcp_bitrate_append_bs|130:       svr.ch-r-0000    197257134    63.724mb/s
11:03:29.735 nv_kcp_bitrate_append_bs|130:       svr.ch-w-0000    222658200    71.959mb/s
11:03:30.735 nv_kcp_bitrate_append_bs|130:       svr.ch-r-0000    272835312    73.733mb/s
11:03:30.736 nv_kcp_bitrate_append_bs|130:       svr.ch-w-0000    301047300    76.399mb/s
11:03:31.738 nv_kcp_bitrate_append_bs|130:       svr.ch-r-0000    339719868    65.122mb/s
11:03:31.738 nv_kcp_bitrate_append_bs|130:       svr.ch-w-0000    375876450    73.002mb/s
11:03:32.746 nv_kcp_bitrate_append_bs|130:       svr.ch-w-0000    441568800    63.644mb/s
11:03:32.746 nv_kcp_bitrate_append_bs|130:       svr.ch-r-0000    411773408    69.806mb/s
11:03:33.752 nv_kcp_bitrate_append_bs|130:       svr.ch-r-0000    479503550    65.748mb/s
11:03:33.774 nv_kcp_bitrate_append_bs|130:       svr.ch-w-0000    512892000    67.754mb/s
11:03:34.754 nv_kcp_bitrate_append_bs|130:       svr.ch-r-0000    545790974    64.605mb/s
11:03:34.809 nv_kcp_bitrate_append_bs|130:       svr.ch-w-0000    592605450    75.140mb/s
11:03:35.774 nv_kcp_bitrate_append_bs|130:       svr.ch-r-0000    609331902    60.835mb/s
11:03:35.810 nv_kcp_bitrate_append_bs|130:       svr.ch-w-0000    665366400    70.985mb/s

mtu=1920, buffSize=10240

11:06:30.665 nv_kcp_bitrate_append_bs|130:       svr.ch-w-0001    101447680    97.895mb/s
11:06:30.665 nv_kcp_bitrate_append_bs|130:       svr.ch-r-0001     97405104    93.994mb/s
11:06:31.668 nv_kcp_bitrate_append_bs|130:       svr.ch-r-0001    183483928    83.810mb/s
11:06:31.668 nv_kcp_bitrate_append_bs|130:       svr.ch-w-0001    206458880   102.243mb/s
11:06:32.670 nv_kcp_bitrate_append_bs|130:       svr.ch-r-0001    264180336    78.648mb/s
11:06:32.670 nv_kcp_bitrate_append_bs|130:       svr.ch-w-0001    311480320   102.355mb/s
11:06:33.675 nv_kcp_bitrate_append_bs|130:       svr.ch-r-0001    343056592    76.644mb/s
11:06:33.701 nv_kcp_bitrate_append_bs|130:       svr.ch-w-0001    401336320    85.112mb/s
11:06:34.685 nv_kcp_bitrate_append_bs|130:       svr.ch-r-0001    435902952    89.773mb/s
11:06:34.712 nv_kcp_bitrate_append_bs|130:       svr.ch-w-0001    509224960   104.214mb/s
11:06:35.687 nv_kcp_bitrate_append_bs|130:       svr.ch-r-0001    524527600    86.375mb/s
11:06:35.728 nv_kcp_bitrate_append_bs|130:       svr.ch-w-0001    611645440    98.445mb/s
11:06:36.701 nv_kcp_bitrate_append_bs|130:       svr.ch-r-0001    603256016    75.822mb/s
11:06:36.730 nv_kcp_bitrate_append_bs|130:       svr.ch-w-0001    696688640    82.884mb/s
11:06:37.707 nv_kcp_bitrate_append_bs|130:       svr.ch-r-0001    701118384    94.999mb/s
11:06:37.736 nv_kcp_bitrate_append_bs|130:       svr.ch-w-0001    787210240    87.786mb/s
11:06:38.708 nv_kcp_bitrate_append_bs|130:       svr.ch-r-0001    774635784    71.723mb/s
11:06:38.743 nv_kcp_bitrate_append_bs|130:       svr.ch-w-0001    867338240    77.783mb/s

感谢您的测试，您的测试结果表明，KCP在本机的速度还是不够快，只有10MB最高速度，大约100Mb左右。

看来不止我一个人的速度有问题。

外网同一个子网的速度测试。

外网跨网（非同一子网）测试。

龙越租赁合同.docx
DDF.PDF

你们是来搞笑的么？KCP 对带宽利用率不充分，不代表 KCP 就只能传输 10MB/s，我刚刚测了一下：

本机传输 71MB/s，受限于 Windows 下面 UDP 的性能了。只能传 10MB/s 的话我之前怎么用它传视频呢？

你们是来搞笑的么？KCP 对带宽利用率不充分，不代表 KCP 就只能传输 10MB/s，我刚刚测了一下：

本机传输 71MB/s，受限于 Windows 下面 UDP 的性能了。只能传 10MB/s 的话我之前怎么用它传视频呢？

能否将这个代码提供下载，或者加入到github中，我们真的是希望kcp搞的好！！！我们才能用的更好啊！！！
感谢您的无私奉献提供这么好的工具给我们，谢谢您！

这是公司项目啊，怎么开源法啊，你可以试试 kcptun 的速度，那是开源的。

这是公司项目啊，怎么开源法啊，你可以试试 kcptun 的速度，那是开源的。

可以简单写一个测试速度的例子啊。。。
kcptun那个不是C++，我们不好测试啊，大哥。

简单写个测速例子？没那么简单，要写 udp 连接握手，会话管理，这就是一套成熟的网络库了。
你直接测试 kcptun 的可执行，本机启动两个，通过 kcptun 把 http 端口 80 代理成 8080，然后就用其他软件下载测速，linux 下面 kcptun 本机基本都是跑 50MB/s 以上的。
kcptun 不是 C++ ，但是用 kcp 的用法你可以借鉴啊。

大哥，俺们只懂C++，什么go不懂啊，也看不了参考不了了，大哥。。。

能不能在HP上实现一下？

hp是啥？

hp是啥？

hp socket,一个开源项目。

你们是来搞笑的么？KCP 对带宽利用率不充分，不代表 KCP 就只能传输 10MB/s，我刚刚测了一下：

本机传输 71MB/s，受限于 Windows 下面 UDP 的性能了。只能传 10MB/s 的话我之前怎么用它传视频呢？

这是windows原生的udp本机测试,什么库没用，就是原生的udp本机收发，这可是250MB/S的速度，发了一分钟左右，丢包率是0.03%,我们用的windows是不一样的？

啥叫作 windows 不一样？

啥叫作 windows 不一样？

你说因为windows原生的udp受限制，所以只能跑到70M/S，我用原生的udp测试了下，不只能跑70M/S，所以说是不是因为不同的windows系统(Windows 7 VS 更高版本的windows)，这个限制有所不一样。还是因为硬件情况(CPU,内存等）。我测试的系统是windows 7 64位旗舰版，CPU是E3-1230 V2(没10年也是8年前买 的了),8G DD3 1333频率的内存。

第一，有ACK包的存在，本机服务的传输 1000 个包的，客户端也要传输 1000 个包的数据，这是加倍的。
第二，我也只是随便设置了下参数，并没有调整的很变态，再增大窗口，发送个 100MB/s 问题不大。
第三，KCP 并没有承诺最大带宽利用率，但是绝不是 10MB/s
--
清楚？

第一，有ACK包的存在，本机服务的传输 1000 个包的，客户端也要传输 1000 个包的 ack，这是加倍的。
第二，我也只是随便设置了下参数，并没有调整的很变态，再增大窗口，发送个 100MB/s 问题不大。
第三，KCP 并没有承诺最大带宽利用率，但是绝不是 10MB/s
--
清楚？

1、包数是双倍了，ack包应该没多大吧，往返流量应该没大多少，只是如果发送方要等ACK回来才发下个包，那肯定是耗费时间的了。
2、你说的窗口是指socket snd buffer和recv buffer吗？
3、我也觉得不应该才那个速率，因为tcp将Ack frenquency设置到每个包都返回ACK，其它都是系统默认，内网中的机子测试也能跑满网卡带宽。

基础知识啊，网络设备的开销，除了带宽外，更主要的是每秒钟处理多少个包，不光是带宽多少。你可以测试下，不管你包多大，你 PC 差不多每秒钟也就能发送 30-50 万个包左右。到了传输介质那里，才是带宽的消耗胜过每秒钟多少个包的消耗。
怎么可能发送方要等 ACK 回来才会发下一个包呢？滑动窗口内，无需等待上一个包的 ack 回来。我说的窗口同时指 tcp 的 sndbuf/rcvbuf 和 kcp 的 snd_wnd, rcv_wnd

基础知识啊，网络设备的开销，除了带宽外，更主要的是每秒钟处理多少个包，不光是带宽多少。你以为本机传输开销主要是流量么？你可以测试下，不管你包多大，你 PC 差不多每秒钟也就能发送 30-50 万个包左右。到了传输介质那里，才是带宽的消耗胜过每秒钟多少个包的消耗。
怎么可能发送方要等 ACK 回来才会发下一个包呢？滑动窗口内，无需等待上一个包的 ack 回来。我说的窗口是 kcp 的 snd_wnd, rcv_wnd ，这两个东西类似 tcp 的 snd_buf 和 rcv_buf，决定收发窗口大小。
基础知识啊。

30万个包那已经挺多了，毕竟每个包1k，那也接近300MB流量了。

本机UDP测试了下，可达900M，排除磁盘IO测试

kcp我调了下参数30M/s， 应该是参数调的不太对

本机UDP测试了下，我电脑最大1.34GB/s，排除磁盘IO测试:

确定计算速度的代码没问题吗？超过1GB/s的速率哪怕是本机内测试也不正常噢。

有总接受字节数和经历的秒数

@whrtqa 把这个库down下来: https://github.com/simdsoft/yasio
确保电脑上安装了vs2013或以上版本和最新版cmake, 直接用cmake生成vs的sln解决方案，跑里面的kcptest工程
记得执行git submodule --init

linux也可以，只要有c++11和cmake就能很方便地编译

阿里云ubuntu服务器更夸张: UDP本机传输速率达到2G bytes/s:

阿里云ubuntu服务器更夸张: UDP本机传输速率达到2G bytes/s:

30-50万个包/秒，这是作者说的。如果你的测试能上1GB+/秒的速率，那可能性只有三个
1、kcp默认的udp包的大小改到很大了。(如果30-50万个包/秒这数字是正确的话，那要达到那速率，每个udp包得20KB以上才理论上可达到那速度，如果上2GB/S，那是要40KB的udp包了）
2、要不作者sky3000弄错了30-50万个包/秒这个数字
3、要不你统计的代码出问题了。

阿里云ubuntu服务器更夸张: UDP本机传输速率达到2G bytes/s:

kcp默认的udp包大小，这个参数改过吗？

Linux 和 windows 不一样，Linux 下面本机网络传输走的是一条代码捷径，根本没走整个 IP 协议栈。

阿里云ubuntu服务器更夸张: UDP本机传输速率达到2G bytes/s:

kcp默认的udp包大小，这个参数改过吗？准确来说是mtu的值。

l

Linux 和 windows 不一样，Linux 下面本机网络传输走的是一条代码捷径，根本没走整个 IP 协议栈。

相当于直接在内核复制数据，连内核与用户层切换都没走？

l

Linux 和 windows 不一样，Linux 下面本机网络传输走的是一条代码捷径，根本没走整个 IP 协议栈。

相当于直接在内核复制数据，连内核与用户层切换都没走？

他的第一次的测试没标记是linux还是windows的，只是写在本机电脑中测试

@whrtqa 把这个库down下来: https://github.com/simdsoft/yasio
确保电脑上安装了vs2013或以上版本和最新版cmake, 直接用cmake生成vs的sln解决方案，跑里面的kcptest工程
记得执行git submodule --init

好的，我尽快试试，今天有点忙。明天或者后天试了之后给大家一个回复

第一个是windows, 我贴出的是纯UDP本机速度，测试代码在这： https://github.com/simdsoft/yasio/blob/master/tests/kcp/main.cpp

第一个是windows, 我贴出的是纯UDP本机速度，测试代码在这： https://github.com/simdsoft/yasio/blob/master/tests/kcp/main.cpp

有没有KCP的测试？

包含，用宏控制

/ KCP speed: 1.3MB/s(windows), 1.8MB/s(linux)
// UDP speed: 1.3GB/s(windows), 2.2GB/s(linux)
#define USE_KCP 0
#if USE_KCP
#define TRANSFER_PROTOCOL YCM_KCP_CLIENT
#else
#define TRANSFER_PROTOCOL YCM_UDP_CLIENT
#endif

好的，感谢！

cmake的时候出错。
@halx99

submodule要down下来

git submodule --init --recursive

@whrtqa 或者直接点击这里下载完整版: https://github.com/simdsoft/yasio/releases/download/v3.31.0-dev10/yasio-3.31.0-full.rar (文件大小1MB)

结果和您的一样。昨天晚上第一次用GIT，不好意思折腾到现在才弄好。
@halx99

kcp的速度是1.1MB-1.2MB
UDP的速度是1.1GB-1.3GB

将KCP的接收和发送的缓存修改为2048，则速度是28-30MB/S
如果将接收的缓存修改更大，修改是12800，则速度很慢又回到3.1MB了

start recive data...
Speed: 7.8MB/s, Total Time: 0.549031(s), Total Bytes: 4485120
Speed: 33.5MB/s, Total Time: 1.06306(s), Total Bytes: 37294080
Speed: 37.5MB/s, Total Time: 1.57309(s), Total Bytes: 61870080
Speed: 36.9MB/s, Total Time: 2.07312(s), Total Bytes: 80179200
Speed: 40.0MB/s, Total Time: 2.58115(s), Total Bytes: 108134400
Speed: 42.2MB/s, Total Time: 3.09318(s), Total Bytes: 136826880
Speed: 43.0MB/s, Total Time: 3.60521(s), Total Bytes: 162447360
Speed: 44.1MB/s, Total Time: 4.13324(s), Total Bytes: 191324160
Speed: 43.4MB/s, Total Time: 4.64527(s), Total Bytes: 211599360
Speed: 40.8MB/s, Total Time: 5.1573(s), Total Bytes: 220385280
Speed: 43.0MB/s, Total Time: 5.65732(s), Total Bytes: 254791680
Speed: 42.8MB/s, Total Time: 6.16435(s), Total Bytes: 276418560
Speed: 43.3MB/s, Total Time: 6.67638(s), Total Bytes: 303329280
Speed: 44.3MB/s, Total Time: 7.18841(s), Total Bytes: 334172160
Speed: 45.2MB/s, Total Time: 7.70044(s), Total Bytes: 365015040
Speed: 45.4MB/s, Total Time: 8.21247(s), Total Bytes: 390942720
Speed: 43.5MB/s, Total Time: 8.83651(s), Total Bytes: 403476480
Speed: 39.9MB/s, Total Time: 9.65255(s), Total Bytes: 403722240
Speed: 38.0MB/s, Total Time: 10.1966(s), Total Bytes: 406732800
Speed: 36.3MB/s, Total Time: 10.7566(s), Total Bytes: 409743360
Speed: 34.7MB/s, Total Time: 11.3326(s), Total Bytes: 412753920
Speed: 33.4MB/s, Total Time: 11.8607(s), Total Bytes: 415703040
Speed: 32.5MB/s, Total Time: 12.3727(s), Total Bytes: 421048320
Speed: 31.3MB/s, Total Time: 12.8847(s), Total Bytes: 422830080
Speed: 29.8MB/s, Total Time: 13.6046(s), Total Bytes: 425779200
Speed: 28.6MB/s, Total Time: 14.2926(s), Total Bytes: 428851200
Speed: 27.8MB/s, Total Time: 14.8206(s), Total Bytes: 431800320
Speed: 26.9MB/s, Total Time: 15.3967(s), Total Bytes: 434749440
Speed: 25.8MB/s, Total Time: 16.0687(s), Total Bytes: 434995200
Speed: 25.1MB/s, Total Time: 16.6127(s), Total Bytes: 438005760
Speed: 24.5MB/s, Total Time: 17.1568(s), Total Bytes: 441016320
Speed: 23.9MB/s, Total Time: 17.7008(s), Total Bytes: 444026880
Speed: 23.3MB/s, Total Time: 18.2768(s), Total Bytes: 447037440
Speed: 22.8MB/s, Total Time: 18.8209(s), Total Bytes: 450048000
Speed: 22.3MB/s, Total Time: 19.4129(s), Total Bytes: 453304320
Speed: 21.8MB/s, Total Time: 19.9409(s), Total Bytes: 456314880
Speed: 21.3MB/s, Total Time: 20.533(s), Total Bytes: 459325440
Speed: 20.7MB/s, Total Time: 21.157(s), Total Bytes: 459571200
Speed: 16.5MB/s, Total Time: 26.5493(s), Total Bytes: 459632640
Assertion failed: seg, file E:\Project\yasio_git\yasio\yasio\kcp\ikcp.c, line 51
8
发送缓存修改为2048，接收缓存修改为5000
速度相当的不稳定16-45MB都有，而且还死机了。

start recive data...
Speed: 24.2MB/s, Total Time: 0.533031(s), Total Bytes: 13516800
Speed: 28.9MB/s, Total Time: 1.07706(s), Total Bytes: 32686080
Speed: 39.0MB/s, Total Time: 1.57709(s), Total Bytes: 64450560
Speed: 37.9MB/s, Total Time: 2.16512(s), Total Bytes: 86138880
Speed: 40.0MB/s, Total Time: 2.67715(s), Total Bytes: 112189440
Speed: 39.5MB/s, Total Time: 3.17718(s), Total Bytes: 131604480
Speed: 40.7MB/s, Total Time: 3.68521(s), Total Bytes: 157102080
Speed: 41.1MB/s, Total Time: 4.19724(s), Total Bytes: 180695040
Speed: 40.7MB/s, Total Time: 4.77327(s), Total Bytes: 203857920
Speed: 36.0MB/s, Total Time: 5.41331(s), Total Bytes: 204103680
Speed: 32.8MB/s, Total Time: 6.02135(s), Total Bytes: 207114240
Speed: 30.4MB/s, Total Time: 6.59738(s), Total Bytes: 210124800
Speed: 28.5MB/s, Total Time: 7.14141(s), Total Bytes: 213135360
Speed: 27.6MB/s, Total Time: 7.73344(s), Total Bytes: 223518720
Speed: 30.0MB/s, Total Time: 8.23347(s), Total Bytes: 258600960
Speed: 31.8MB/s, Total Time: 8.7415(s), Total Bytes: 291348480
Speed: 32.7MB/s, Total Time: 9.25353(s), Total Bytes: 317276160
Speed: 33.6MB/s, Total Time: 9.76556(s), Total Bytes: 344186880
Speed: 34.9MB/s, Total Time: 10.2656(s), Total Bytes: 375275520
Speed: 36.0MB/s, Total Time: 10.7736(s), Total Bytes: 406241280
Speed: 36.5MB/s, Total Time: 11.2846(s), Total Bytes: 432230400
Speed: 37.6MB/s, Total Time: 11.7847(s), Total Bytes: 464056320
Speed: 37.5MB/s, Total Time: 12.3087(s), Total Bytes: 484024320
Speed: 37.9MB/s, Total Time: 12.8087(s), Total Bytes: 509644800
Speed: 38.2MB/s, Total Time: 13.3168(s), Total Bytes: 533544960
Speed: 39.4MB/s, Total Time: 13.8288(s), Total Bytes: 571576320
Speed: 38.7MB/s, Total Time: 14.4208(s), Total Bytes: 584847360
Speed: 37.4MB/s, Total Time: 14.9809(s), Total Bytes: 587857920
Speed: 36.5MB/s, Total Time: 15.5249(s), Total Bytes: 593633280
Speed: 35.5MB/s, Total Time: 16.1009(s), Total Bytes: 599470080
Speed: 36.9MB/s, Total Time: 16.613(s), Total Bytes: 642600960
Speed: 37.4MB/s, Total Time: 17.113(s), Total Bytes: 671723520
Speed: 37.9MB/s, Total Time: 17.637(s), Total Bytes: 700108800
Speed: 38.1MB/s, Total Time: 18.149(s), Total Bytes: 725176320
Speed: 39.3MB/s, Total Time: 18.6611(s), Total Bytes: 768614400
Speed: 38.9MB/s, Total Time: 19.2371(s), Total Bytes: 784527360
Speed: 37.8MB/s, Total Time: 19.8611(s), Total Bytes: 787537920
Speed: 36.9MB/s, Total Time: 20.4372(s), Total Bytes: 791162880
Speed: 36.2MB/s, Total Time: 20.9492(s), Total Bytes: 794112000
Speed: 35.2MB/s, Total Time: 21.4932(s), Total Bytes: 794296320
Speed: 34.3MB/s, Total Time: 22.1813(s), Total Bytes: 797306880
Speed: 33.4MB/s, Total Time: 22.8373(s), Total Bytes: 800317440
Speed: 32.8MB/s, Total Time: 23.3813(s), Total Bytes: 803328000
Speed: 32.2MB/s, Total Time: 23.9094(s), Total Bytes: 806338560
Speed: 31.6MB/s, Total Time: 24.4534(s), Total Bytes: 809349120
Speed: 31.0MB/s, Total Time: 24.9654(s), Total Bytes: 812359680
Speed: 30.5MB/s, Total Time: 25.5735(s), Total Bytes: 818196480
Speed: 30.1MB/s, Total Time: 26.1175(s), Total Bytes: 823971840
Speed: 30.2MB/s, Total Time: 26.6295(s), Total Bytes: 844124160
Speed: 30.6MB/s, Total Time: 27.1296(s), Total Bytes: 870727680
Speed: 31.2MB/s, Total Time: 27.6376(s), Total Bytes: 903782400
Speed: 31.6MB/s, Total Time: 28.1376(s), Total Bytes: 932720640
Speed: 32.1MB/s, Total Time: 28.6446(s), Total Bytes: 963072000
Speed: 31.7MB/s, Total Time: 29.1567(s), Total Bytes: 968478720
Speed: 31.1MB/s, Total Time: 29.7967(s), Total Bytes: 971489280
Speed: 30.6MB/s, Total Time: 30.3887(s), Total Bytes: 974499840
Speed: 30.1MB/s, Total Time: 30.9968(s), Total Bytes: 977510400
Speed: 29.5MB/s, Total Time: 31.6368(s), Total Bytes: 977756160
Speed: 29.1MB/s, Total Time: 32.1648(s), Total Bytes: 980705280
Speed: 28.7MB/s, Total Time: 32.6929(s), Total Bytes: 983715840
Speed: 28.2MB/s, Total Time: 33.3169(s), Total Bytes: 986726400
Speed: 27.8MB/s, Total Time: 33.9569(s), Total Bytes: 989736960
Speed: 27.4MB/s, Total Time: 34.533(s), Total Bytes: 992747520
Speed: 27.1MB/s, Total Time: 35.077(s), Total Bytes: 995758080
Speed: 26.7MB/s, Total Time: 35.621(s), Total Bytes: 998768640
Speed: 26.4MB/s, Total Time: 36.1491(s), Total Bytes: 1001779200
Speed: 26.1MB/s, Total Time: 36.6931(s), Total Bytes: 1004789760
Speed: 25.8MB/s, Total Time: 37.2371(s), Total Bytes: 1007800320
Speed: 25.5MB/s, Total Time: 37.7812(s), Total Bytes: 1010749440
Speed: 25.2MB/s, Total Time: 38.3252(s), Total Bytes: 1013760000
Speed: 24.9MB/s, Total Time: 38.9812(s), Total Bytes: 1016770560
Speed: 24.6MB/s, Total Time: 39.5573(s), Total Bytes: 1019781120
Speed: 24.3MB/s, Total Time: 40.1333(s), Total Bytes: 1022791680
Speed: 24.0MB/s, Total Time: 40.6773(s), Total Bytes: 1025802240
Speed: 23.8MB/s, Total Time: 41.2054(s), Total Bytes: 1028812800
Speed: 23.6MB/s, Total Time: 41.7494(s), Total Bytes: 1031761920
Speed: 23.3MB/s, Total Time: 42.2774(s), Total Bytes: 1034772480
Speed: 23.1MB/s, Total Time: 42.8375(s), Total Bytes: 1037783040
Speed: 22.9MB/s, Total Time: 43.3655(s), Total Bytes: 1040793600
Speed: 22.6MB/s, Total Time: 43.9095(s), Total Bytes: 1040977920
Speed: 22.4MB/s, Total Time: 44.4535(s), Total Bytes: 1043927040
Speed: 22.2MB/s, Total Time: 45.0136(s), Total Bytes: 1046937600
Speed: 22.0MB/s, Total Time: 45.5416(s), Total Bytes: 1049886720
Speed: 21.7MB/s, Total Time: 46.0696(s), Total Bytes: 1050071040
Speed: 21.5MB/s, Total Time: 46.6127(s), Total Bytes: 1053081600
Speed: 21.4MB/s, Total Time: 47.1887(s), Total Bytes: 1058918400
Speed: 21.2MB/s, Total Time: 47.7327(s), Total Bytes: 1061928960
Speed: 21.1MB/s, Total Time: 48.2928(s), Total Bytes: 1068871680
Speed: 20.9MB/s, Total Time: 48.9648(s), Total Bytes: 1071882240
Speed: 20.7MB/s, Total Time: 49.5248(s), Total Bytes: 1074892800
Speed: 20.5MB/s, Total Time: 50.0849(s), Total Bytes: 1075077120
Speed: 20.3MB/s, Total Time: 50.6289(s), Total Bytes: 1078087680
Speed: 20.1MB/s, Total Time: 51.2369(s), Total Bytes: 1081098240
Speed: 20.0MB/s, Total Time: 51.765(s), Total Bytes: 1084108800
Speed: 19.8MB/s, Total Time: 52.357(s), Total Bytes: 1087119360
Speed: 19.7MB/s, Total Time: 52.901(s), Total Bytes: 1091420160
请按任意键继续. . .
又挂了。

前面的速度是release的速度，如果是debug只有不到1MB（发送缓存2048，接收5000）的设置
而且也死机了，这个运算量也不大的，CPU的利用率不高。而且5000，铁定了要死机。

cmake的时候，我选择是win 32位 vs2013版本。
我刚才测试了发送和接收的缓存为512，都会挂。

start recive data...
Speed: 5.5MB/s, Total Time: 0.501029(s), Total Bytes: 2887680
Speed: 12.8MB/s, Total Time: 1.01306(s), Total Bytes: 13639680
Speed: 11.4MB/s, Total Time: 1.52509(s), Total Bytes: 18247680
Speed: 11.3MB/s, Total Time: 2.03712(s), Total Bytes: 24084480
Speed: 12.6MB/s, Total Time: 2.56515(s), Total Bytes: 33792000
Speed: 12.0MB/s, Total Time: 3.09318(s), Total Bytes: 38768640
Speed: 11.6MB/s, Total Time: 3.62121(s), Total Bytes: 44175360
Speed: 11.6MB/s, Total Time: 4.13324(s), Total Bytes: 50073600
Speed: 11.3MB/s, Total Time: 4.64527(s), Total Bytes: 54865920
Speed: 11.7MB/s, Total Time: 5.1573(s), Total Bytes: 63098880
Speed: 11.4MB/s, Total Time: 5.66932(s), Total Bytes: 67891200
Speed: 11.7MB/s, Total Time: 6.19735(s), Total Bytes: 76185600
Speed: 11.5MB/s, Total Time: 6.70938(s), Total Bytes: 80977920
Speed: 11.4MB/s, Total Time: 7.22041(s), Total Bytes: 86138880
Speed: 11.4MB/s, Total Time: 7.73244(s), Total Bytes: 92467200
Speed: 11.3MB/s, Total Time: 8.24447(s), Total Bytes: 97996800
Speed: 11.2MB/s, Total Time: 8.7565(s), Total Bytes: 102789120
Speed: 11.1MB/s, Total Time: 9.28453(s), Total Bytes: 108011520
Speed: 11.0MB/s, Total Time: 9.79656(s), Total Bytes: 113172480
Speed: 11.0MB/s, Total Time: 10.3086(s), Total Bytes: 118579200
Speed: 10.9MB/s, Total Time: 10.8366(s), Total Bytes: 123985920
Speed: 10.9MB/s, Total Time: 11.3646(s), Total Bytes: 129392640
Speed: 11.1MB/s, Total Time: 11.8767(s), Total Bytes: 137748480
Speed: 11.0MB/s, Total Time: 12.4047(s), Total Bytes: 143462400
Speed: 11.2MB/s, Total Time: 12.9327(s), Total Bytes: 151941120
Speed: 11.1MB/s, Total Time: 13.4608(s), Total Bytes: 156979200
Speed: 11.1MB/s, Total Time: 13.9888(s), Total Bytes: 162324480
Speed: 11.1MB/s, Total Time: 14.5168(s), Total Bytes: 168222720
Speed: 11.2MB/s, Total Time: 15.0449(s), Total Bytes: 176087040
Speed: 11.1MB/s, Total Time: 15.5569(s), Total Bytes: 180940800
Speed: 11.1MB/s, Total Time: 16.0689(s), Total Bytes: 186347520
Speed: 11.2MB/s, Total Time: 16.5969(s), Total Bytes: 195133440
Speed: 11.2MB/s, Total Time: 17.125(s), Total Bytes: 200294400
Speed: 11.3MB/s, Total Time: 17.637(s), Total Bytes: 209326080
Speed: 11.4MB/s, Total Time: 18.149(s), Total Bytes: 217743360
Speed: 11.4MB/s, Total Time: 18.6611(s), Total Bytes: 222412800
Speed: 11.4MB/s, Total Time: 19.1731(s), Total Bytes: 229847040
Speed: 11.4MB/s, Total Time: 19.6851(s), Total Bytes: 236113920
Speed: 11.4MB/s, Total Time: 20.1972(s), Total Bytes: 240967680
Speed: 11.5MB/s, Total Time: 20.7092(s), Total Bytes: 248832000
Speed: 11.6MB/s, Total Time: 21.2372(s), Total Bytes: 258416640
Speed: 11.7MB/s, Total Time: 21.7652(s), Total Bytes: 266096640
Speed: 11.7MB/s, Total Time: 22.2773(s), Total Bytes: 273899520
Speed: 11.7MB/s, Total Time: 22.7893(s), Total Bytes: 279490560
Speed: 11.7MB/s, Total Time: 23.3173(s), Total Bytes: 287170560
Speed: 11.4MB/s, Total Time: 24.0214(s), Total Bytes: 287232000
Speed: 11.2MB/s, Total Time: 24.5484(s), Total Bytes: 287293440
Speed: 11.3MB/s, Total Time: 25.0604(s), Total Bytes: 297369600
Speed: 11.7MB/s, Total Time: 25.5725(s), Total Bytes: 313221120
Speed: 12.0MB/s, Total Time: 26.0845(s), Total Bytes: 328581120
Speed: 12.3MB/s, Total Time: 26.5965(s), Total Bytes: 343818240
Speed: 12.8MB/s, Total Time: 27.1086(s), Total Bytes: 364154880
Speed: 13.2MB/s, Total Time: 27.6206(s), Total Bytes: 381358080
Speed: 13.3MB/s, Total Time: 28.1326(s), Total Bytes: 392540160
Speed: 13.4MB/s, Total Time: 28.6446(s), Total Bytes: 402493440
Speed: 13.4MB/s, Total Time: 29.1567(s), Total Bytes: 409313280
Speed: 13.6MB/s, Total Time: 29.6687(s), Total Bytes: 422522880
Speed: 13.7MB/s, Total Time: 30.1807(s), Total Bytes: 434749440
Speed: 13.7MB/s, Total Time: 30.6928(s), Total Bytes: 441507840
Speed: 13.8MB/s, Total Time: 31.2048(s), Total Bytes: 451584000
Speed: 13.8MB/s, Total Time: 31.7168(s), Total Bytes: 460185600
Speed: 14.1MB/s, Total Time: 32.2288(s), Total Bytes: 477265920
Speed: 14.2MB/s, Total Time: 32.7409(s), Total Bytes: 486543360
Speed: 14.4MB/s, Total Time: 33.2529(s), Total Bytes: 501780480
Speed: 14.6MB/s, Total Time: 33.7649(s), Total Bytes: 518369280
Speed: 14.8MB/s, Total Time: 34.277(s), Total Bytes: 531333120
Speed: 15.0MB/s, Total Time: 34.789(s), Total Bytes: 545587200
Speed: 15.1MB/s, Total Time: 35.301(s), Total Bytes: 557199360
Speed: 15.2MB/s, Total Time: 35.813(s), Total Bytes: 569917440
Speed: 15.3MB/s, Total Time: 36.3251(s), Total Bytes: 583249920
Speed: 15.4MB/s, Total Time: 36.8371(s), Total Bytes: 596582400
Speed: 15.6MB/s, Total Time: 37.3491(s), Total Bytes: 612802560
Speed: 15.6MB/s, Total Time: 37.8612(s), Total Bytes: 619622400
Speed: 15.6MB/s, Total Time: 38.3732(s), Total Bytes: 626810880
Speed: 15.8MB/s, Total Time: 38.8852(s), Total Bytes: 643706880
Speed: 15.9MB/s, Total Time: 39.3973(s), Total Bytes: 657039360
Speed: 16.0MB/s, Total Time: 39.9253(s), Total Bytes: 669081600
Speed: 16.1MB/s, Total Time: 40.4373(s), Total Bytes: 683581440
Speed: 16.4MB/s, Total Time: 40.9493(s), Total Bytes: 703856640
Speed: 16.4MB/s, Total Time: 41.4614(s), Total Bytes: 712335360
Speed: 16.6MB/s, Total Time: 41.9724(s), Total Bytes: 728924160
Speed: 16.6MB/s, Total Time: 42.4844(s), Total Bytes: 737771520
Speed: 16.6MB/s, Total Time: 42.9965(s), Total Bytes: 749445120
Speed: 16.7MB/s, Total Time: 43.5085(s), Total Bytes: 763944960
Speed: 16.7MB/s, Total Time: 44.0205(s), Total Bytes: 771440640
Speed: 16.8MB/s, Total Time: 44.5325(s), Total Bytes: 783912960
Speed: 16.9MB/s, Total Time: 45.0446(s), Total Bytes: 798105600
Speed: 16.8MB/s, Total Time: 45.5726(s), Total Bytes: 802467840
Assertion failed: seg, file E:\Project\yasio_git\yasio\yasio\kcp\ikcp.c, line 51
8
请按任意键继续. . .

看样子是内存爆了

@halx99
刚才我又恢复了原来的代码，默认的参数，还是挂了！

这里，kcp的 包/s 速率不能太大， 实现上和系统udp不一样，发包本身不是很优雅，不想UDP，我是在发送回调里直接发下一个包，而kcp还没能实现单独一个包发送完成的回调。
UDP是自己管理队列，KCP是交给KCP自己内部去管理发送队列，具体你可以看这两个函数的区别:
void udp_send_repeat_forever(io_service* service, transport_handle_t thandle, obstream* obs)
{
  auto cb = [=] {
    if (s_bytes_sent > 0)
    {
      udp_send_repeat_forever(service, thandle, obs);
    }
  };

  s_bytes_sent = service->write(thandle, obs->buffer(), cb);
}

void kcp_send_repeat_forever(io_service* service, transport_handle_t thandle, obstream* obs)
{
  s_bytes_sent = service->write(thandle, obs->buffer());

  if (s_bytes_sent > 0)
  {
    service->schedule(std::chrono::milliseconds(1),
                      [=](bool) { kcp_send_repeat_forever(service, thandle, obs); });
  }
}

我是菜鸟啊，不知道该怎么处理比较好。就想拿来就用了。。。

我能想到另一个实现是为kcp单开一个发送线程，类似的把kcp假定为内核驱动协议，实现上还是自己维护队列，将ikcp_send视为socket, send, 只要返回成功，就当成一次包发送完成，而那个单独线程的处理发送速度必须足够快，也就是sleep的时间根据实际发送需求动态调整，这个还是需要kcp作者大佬出来亲自解释下，如何在非阻塞io模型下，优雅地加入kcp

能够像使用内核send,recv一样，socket的读写事件都能立刻唤醒网络服务线程进行处理

@halx99 ,感谢您的付出！也希望KCP越走越好哈！！！

@skywind3000 请问大佬，这个速度能提升么？
迫切希望能越快越好啊！

现在速度是多少啊？看不懂你们的截图。

我试了下， interval改成0， 速度可以达到54M/s,  业务每毫秒发送1ms， kcp基本可以及时处理发送(内存不会持续增长）

意思是KCP的最高速度就是55MB

业务还有个1ms间隔吧，如果去掉间隔可能会更快

我修改成了0，还是有内存问题，还是挂了，速度也没有上去。缓存2048的情况下。
start recive data...
Speed: 3.5MB/s, Total Time: 0.502028(s), Total Bytes: 1843200
Speed: 9.6MB/s, Total Time: 1.01606(s), Total Bytes: 10199040
Speed: 17.5MB/s, Total Time: 1.57409(s), Total Bytes: 28938240
Speed: 15.3MB/s, Total Time: 2.11812(s), Total Bytes: 34037760
Speed: 16.6MB/s, Total Time: 2.63015(s), Total Bytes: 45834240
Speed: 18.1MB/s, Total Time: 3.22218(s), Total Bytes: 61194240
Speed: 17.3MB/s, Total Time: 3.78222(s), Total Bytes: 68567040
Speed: 17.8MB/s, Total Time: 4.29425(s), Total Bytes: 79933440
Speed: 18.9MB/s, Total Time: 4.80628(s), Total Bytes: 95416320
Speed: 17.4MB/s, Total Time: 5.51032(s), Total Bytes: 100331520
Speed: 16.9MB/s, Total Time: 6.03834(s), Total Bytes: 106905600
Speed: 19.6MB/s, Total Time: 6.59656(s), Total Bytes: 135782400
Speed: 21.7MB/s, Total Time: 7.09757(s), Total Bytes: 161771520
Speed: 23.6MB/s, Total Time: 7.62219(s), Total Bytes: 188928000
Speed: 24.7MB/s, Total Time: 8.13422(s), Total Bytes: 210984960
Speed: 25.0MB/s, Total Time: 8.66225(s), Total Bytes: 226775040
Speed: 26.1MB/s, Total Time: 9.17428(s), Total Bytes: 251473920
Speed: 26.9MB/s, Total Time: 9.68631(s), Total Bytes: 273653760
Speed: 28.4MB/s, Total Time: 10.1983(s), Total Bytes: 303820800
Speed: 28.6MB/s, Total Time: 10.7424(s), Total Bytes: 322191360
Speed: 29.7MB/s, Total Time: 11.2424(s), Total Bytes: 350515200
Speed: 31.1MB/s, Total Time: 11.7504(s), Total Bytes: 383078400
Speed: 31.9MB/s, Total Time: 12.2785(s), Total Bytes: 410849280
Speed: 32.2MB/s, Total Time: 12.7905(s), Total Bytes: 432046080
Speed: 33.2MB/s, Total Time: 13.2905(s), Total Bytes: 462458880
Speed: 33.2MB/s, Total Time: 13.7963(s), Total Bytes: 480522240
Speed: 33.6MB/s, Total Time: 14.3039(s), Total Bytes: 504176640
Speed: 32.7MB/s, Total Time: 14.8706(s), Total Bytes: 509952000
Speed: 31.7MB/s, Total Time: 15.4946(s), Total Bytes: 515727360
Speed: 30.9MB/s, Total Time: 16.0856(s), Total Bytes: 521502720
Speed: 30.0MB/s, Total Time: 16.6617(s), Total Bytes: 524574720
Speed: 29.4MB/s, Total Time: 17.1897(s), Total Bytes: 530411520
Speed: 28.8MB/s, Total Time: 17.7017(s), Total Bytes: 534220800
Speed: 28.2MB/s, Total Time: 18.2138(s), Total Bytes: 539258880
Speed: 27.7MB/s, Total Time: 18.7578(s), Total Bytes: 545280000
Speed: 27.1MB/s, Total Time: 19.2698(s), Total Bytes: 548474880
Speed: 27.2MB/s, Total Time: 19.8458(s), Total Bytes: 566599680
Speed: 27.5MB/s, Total Time: 20.3739(s), Total Bytes: 586444800
Speed: 24.8MB/s, Total Time: 22.5124(s), Total Bytes: 586506240
Speed: 21.8MB/s, Total Time: 25.6861(s), Total Bytes: 588165120
Speed: 22.6MB/s, Total Time: 26.2301(s), Total Bytes: 621219840
Speed: 22.4MB/s, Total Time: 26.7901(s), Total Bytes: 630497280
Speed: 22.1MB/s, Total Time: 27.3022(s), Total Bytes: 632094720
Speed: 21.8MB/s, Total Time: 27.8622(s), Total Bytes: 637747200
Speed: 21.7MB/s, Total Time: 28.4542(s), Total Bytes: 646963200
Speed: 22.2MB/s, Total Time: 28.9663(s), Total Bytes: 673505280
Speed: 22.2MB/s, Total Time: 29.4943(s), Total Bytes: 687390720
Speed: 23.2MB/s, Total Time: 30.0063(s), Total Bytes: 729722880
Speed: 22.9MB/s, Total Time: 30.5343(s), Total Bytes: 732856320
Speed: 22.5MB/s, Total Time: 31.1424(s), Total Bytes: 733286400
Speed: 22.1MB/s, Total Time: 31.8466(s), Total Bytes: 736358400
Speed: 21.8MB/s, Total Time: 32.3896(s), Total Bytes: 739491840
Speed: 21.6MB/s, Total Time: 32.9657(s), Total Bytes: 745328640
Speed: 21.2MB/s, Total Time: 33.6057(s), Total Bytes: 748400640
Speed: 20.9MB/s, Total Time: 34.1497(s), Total Bytes: 748523520
Speed: 20.7MB/s, Total Time: 34.6644(s), Total Bytes: 751718400
Speed: 20.4MB/s, Total Time: 35.2288(s), Total Bytes: 754667520
Speed: 20.1MB/s, Total Time: 35.8782(s), Total Bytes: 757616640
Speed: 20.0MB/s, Total Time: 36.3902(s), Total Bytes: 763392000
Speed: 19.8MB/s, Total Time: 36.9023(s), Total Bytes: 766464000
Speed: 19.6MB/s, Total Time: 37.4783(s), Total Bytes: 769597440
Speed: 19.5MB/s, Total Time: 38.1023(s), Total Bytes: 780410880
Speed: 19.3MB/s, Total Time: 38.6464(s), Total Bytes: 783360000
Speed: 19.1MB/s, Total Time: 39.3664(s), Total Bytes: 787968000
Speed: 18.9MB/s, Total Time: 39.9264(s), Total Bytes: 790978560
Speed: 18.7MB/s, Total Time: 40.4705(s), Total Bytes: 794050560
Speed: 18.5MB/s, Total Time: 41.0145(s), Total Bytes: 797061120
Speed: 18.3MB/s, Total Time: 41.6545(s), Total Bytes: 797245440
Speed: 18.0MB/s, Total Time: 42.2306(s), Total Bytes: 797368320
Speed: 17.8MB/s, Total Time: 42.8706(s), Total Bytes: 800256000
Speed: 17.5MB/s, Total Time: 43.5416(s), Total Bytes: 800378880
Speed: 17.4MB/s, Total Time: 44.0857(s), Total Bytes: 804986880
Speed: 17.3MB/s, Total Time: 44.5977(s), Total Bytes: 807997440
Speed: 17.4MB/s, Total Time: 45.1257(s), Total Bytes: 822005760
Speed: 17.3MB/s, Total Time: 45.6267(s), Total Bytes: 827658240
Speed: 17.1MB/s, Total Time: 46.1497(s), Total Bytes: 827904000
Speed: 17.3MB/s, Total Time: 46.6658(s), Total Bytes: 848363520
Speed: 17.2MB/s, Total Time: 47.2232(s), Total Bytes: 851435520
Speed: 17.0MB/s, Total Time: 47.8298(s), Total Bytes: 851681280
Speed: 16.8MB/s, Total Time: 48.4538(s), Total Bytes: 851927040
Speed: 16.5MB/s, Total Time: 49.2219(s), Total Bytes: 852480000
Speed: 16.7MB/s, Total Time: 49.7285(s), Total Bytes: 869068800
Speed: 16.6MB/s, Total Time: 50.2817(s), Total Bytes: 877363200
Speed: 16.5MB/s, Total Time: 50.7959(s), Total Bytes: 880373760
Speed: 16.4MB/s, Total Time: 51.4143(s), Total Bytes: 886702080
Speed: 16.2MB/s, Total Time: 52.1977(s), Total Bytes: 886886400
Speed: 16.0MB/s, Total Time: 52.7738(s), Total Bytes: 887009280
Speed: 15.9MB/s, Total Time: 53.307(s), Total Bytes: 889958400
Speed: 15.8MB/s, Total Time: 53.8138(s), Total Bytes: 890142720
Speed: 16.1MB/s, Total Time: 54.3258(s), Total Bytes: 917729280
Speed: 16.6MB/s, Total Time: 54.8488(s), Total Bytes: 952135680
Speed: 16.5MB/s, Total Time: 55.3488(s), Total Bytes: 956805120
Speed: 16.5MB/s, Total Time: 55.8516(s), Total Bytes: 966082560
Speed: 16.8MB/s, Total Time: 56.3744(s), Total Bytes: 993730560
Speed: 17.3MB/s, Total Time: 56.8745(s), Total Bytes: 1031086080
Speed: 16.0MB/s, Total Time: 61.4297(s), Total Bytes: 1031147520
Speed: 16.0MB/s, Total Time: 61.9897(s), Total Bytes: 1036984320
Speed: 15.8MB/s, Total Time: 62.5337(s), Total Bytes: 1037230080
Assertion failed: seg, file E:\Project\yasio_git\yasio\yasio\kcp\ikcp.c, line 51
8
请按任意键继续. . .

改kcp源码，里面有控制，最低10

const IUINT32 IKCP_INTERVAL	= 0;  //100,默认值
我修改的这个

@halx99
内存的问题解决了，没有增加了。
但是速度还是和原来的一样，没有改变。
奇怪的是我现在的速度只有10MB多了，上午的时候还有35MB。

const IUINT32 IKCP_INTERVAL = 0;
不要修改这个，这个是标准界限。
你自己在外面手工设置：
kcp->interval = xxx;

就行了。

@halx99
内存的问题解决了，没有增加了。
但是速度还是和原来的一样，没有改变。
奇怪的是我现在的速度只有10MB多了，上午的时候还有35MB。
CPU的消耗很低。
你pull一下最新yasio代码，我调出了下面的速度，去掉了测试用例里的发送间隔
yasio.cpp代码 io_transport_kcp构造函数修改如下(另外还是在ikcp_nodelay函数里去除kcp的10ms限制):

io_transport_kcp::io_transport_kcp(io_channel* ctx, std::shared_ptr<xxsocket>& s)
    : io_transport(ctx, s), kcp_(nullptr)
{
  this->kcp_ = ::ikcp_create(0, this);
  ::ikcp_nodelay(this->kcp_, 1, 0 /*MAX_WAIT_DURATION / 1000*/, 2, 1);
  ::ikcp_wndsize(this->kcp_, 4096, 8192);
  ::ikcp_setmtu(this->kcp_, YASIO_SZ(63, k));
  ::ikcp_setoutput(this->kcp_, [](const char* buf, int len, ::ikcpcb* /*kcp*/, void* user) {
    auto t = (transport_handle_t)user;
    return t->socket_->send(buf, len);
  });
}

start recive data...
Speed: 2.2MB/s, Total Time: 0.530401(s), Total Bytes: 1206272
Speed: 3.0MB/s, Total Time: 1.0452(s), Total Bytes: 3237888
Speed: 3.3MB/s, Total Time: 1.5756(s), Total Bytes: 5459968
Speed: 3.4MB/s, Total Time: 2.106(s), Total Bytes: 7555072
Speed: 3.5MB/s, Total Time: 2.6208(s), Total Bytes: 9650176
Speed: 3.6MB/s, Total Time: 3.16681(s), Total Bytes: 11872256
Speed: 3.6MB/s, Total Time: 3.71281(s), Total Bytes: 14094336
Speed: 3.7MB/s, Total Time: 4.22761(s), Total Bytes: 16189440
Speed: 3.7MB/s, Total Time: 4.75801(s), Total Bytes: 18348032
Speed: 3.7MB/s, Total Time: 5.30401(s), Total Bytes: 20570112
Speed: 3.7MB/s, Total Time: 5.83441(s), Total Bytes: 22792192
Speed: 3.7MB/s, Total Time: 6.36481(s), Total Bytes: 24887296
Speed: 3.7MB/s, Total Time: 6.87961(s), Total Bytes: 26982400
Speed: 3.8MB/s, Total Time: 7.41001(s), Total Bytes: 29140992
Speed: 3.8MB/s, Total Time: 7.92481(s), Total Bytes: 31236096
Speed: 3.8MB/s, Total Time: 8.43961(s), Total Bytes: 33331200
Speed: 3.8MB/s, Total Time: 8.97002(s), Total Bytes: 35489792
Speed: 3.8MB/s, Total Time: 9.51602(s), Total Bytes: 37711872
Speed: 3.8MB/s, Total Time: 10.0464(s), Total Bytes: 39870464
Speed: 3.8MB/s, Total Time: 10.5924(s), Total Bytes: 42092544
Speed: 3.8MB/s, Total Time: 11.1384(s), Total Bytes: 44314624
Speed: 3.8MB/s, Total Time: 11.6844(s), Total Bytes: 46536704
Speed: 3.8MB/s, Total Time: 12.1992(s), Total Bytes: 48631808
Speed: 3.8MB/s, Total Time: 12.714(s), Total Bytes: 50726912
Speed: 3.8MB/s, Total Time: 13.2288(s), Total Bytes: 52822016
Speed: 3.8MB/s, Total Time: 13.7748(s), Total Bytes: 55044096
Speed: 3.8MB/s, Total Time: 14.3208(s), Total Bytes: 57266176
Speed: 3.8MB/s, Total Time: 14.8668(s), Total Bytes: 59488256
Speed: 3.8MB/s, Total Time: 15.3972(s), Total Bytes: 61646848
Speed: 3.6MB/s, Total Time: 16.5672(s), Total Bytes: 61710336
Speed: 3.3MB/s, Total Time: 17.7372(s), Total Bytes: 61837312
Speed: 3.2MB/s, Total Time: 18.6264(s), Total Bytes: 61900800
Speed: 2.9MB/s, Total Time: 20.904(s), Total Bytes: 64059392
Speed: 2.7MB/s, Total Time: 22.2612(s), Total Bytes: 64122880
Speed: 2.7MB/s, Total Time: 23.556(s), Total Bytes: 67043328
Speed: 2.9MB/s, Total Time: 24.0864(s), Total Bytes: 72693760
Speed: 3.2MB/s, Total Time: 24.6168(s), Total Bytes: 83296256
修改发送和接收缓存2048之后的结果。
在3.2MB/S之后不动了，持续很长时间了，不动了。

Speed: 5.3MB/s, Total Time: 5.0932(s), Total Bytes: 28379136
Speed: 5.3MB/s, Total Time: 5.60203(s), Total Bytes: 31363072
Speed: 5.3MB/s, Total Time: 6.10359(s), Total Bytes: 34220032
Speed: 5.4MB/s, Total Time: 6.62329(s), Total Bytes: 37203968
Speed: 5.4MB/s, Total Time: 7.13194(s), Total Bytes: 40187904
Speed: 5.4MB/s, Total Time: 7.63358(s), Total Bytes: 43044864
Speed: 5.4MB/s, Total Time: 8.14329(s), Total Bytes: 46028800
Speed: 5.4MB/s, Total Time: 8.65301(s), Total Bytes: 48949248
Speed: 5.4MB/s, Total Time: 9.17371(s), Total Bytes: 51933184
Speed: 5.4MB/s, Total Time: 9.68338(s), Total Bytes: 54917120
Speed: 5.4MB/s, Total Time: 10.193(s), Total Bytes: 57837568
Speed: 5.4MB/s, Total Time: 10.6937(s), Total Bytes: 60758016
Speed: 5.4MB/s, Total Time: 11.2034(s), Total Bytes: 63678464
Speed: 5.4MB/s, Total Time: 11.7131(s), Total Bytes: 66598912
Speed: 5.4MB/s, Total Time: 12.2228(s), Total Bytes: 69582848
Speed: 5.4MB/s, Total Time: 12.7235(s), Total Bytes: 72439808
Speed: 5.4MB/s, Total Time: 13.2332(s), Total Bytes: 75423744
Speed: 5.4MB/s, Total Time: 13.7429(s), Total Bytes: 78344192
Speed: 5.4MB/s, Total Time: 14.2536(s), Total Bytes: 81264640
Speed: 5.4MB/s, Total Time: 14.7632(s), Total Bytes: 84248576
Speed: 5.4MB/s, Total Time: 15.2729(s), Total Bytes: 87169024
Speed: 5.4MB/s, Total Time: 15.7735(s), Total Bytes: 90089472
Speed: 5.4MB/s, Total Time: 16.2833(s), Total Bytes: 93009920
Speed: 5.4MB/s, Total Time: 16.8029(s), Total Bytes: 95993856
Speed: 5.5MB/s, Total Time: 17.3036(s), Total Bytes: 98914304
Speed: 5.5MB/s, Total Time: 17.8133(s), Total Bytes: 101834752
Speed: 5.5MB/s, Total Time: 18.323(s), Total Bytes: 104818688
Speed: 5.5MB/s, Total Time: 18.8238(s), Total Bytes: 107675648
Speed: 5.5MB/s, Total Time: 19.3326(s), Total Bytes: 110659584
Speed: 5.5MB/s, Total Time: 19.833(s), Total Bytes: 113516544
@halx99
用你的代码，根据你回复的修改，在windows10 64位下跑的结果。

为避免挂掉，发送方只发20s

@halx99 明白了，感谢！
奇怪你的速度怎么这么快？
我以为是我一个人慢，还好，还有另外一个兄台的。

@halx99 明白了，感谢！
奇怪你的速度怎么这么快？
我以为是我一个人慢，还好，还有另外一个兄台的。

他的测试平台在nix，作者不是说了nix平台本地收发不走IP协议栈，直接走快捷通道吗？我理解那个快捷通道应该就是数据在内核中直接复制差不多吧。

@halx99 明白了，感谢！
奇怪你的速度怎么这么快？
我以为是我一个人慢，还好，还有另外一个兄台的。

他的测试平台在_nix，作者不是说了_nix平台本地收发不走IP协议栈，直接走快捷通道吗？我理解那个快捷通道应该就是数据在内核中直接复制差不多吧。

实际上，本机传输不管是win还是nix都不走协议栈

start recive data...
Speed: 2.2MB/s, Total Time: 0.530401(s), Total Bytes: 1206272
Speed: 3.0MB/s, Total Time: 1.0452(s), Total Bytes: 3237888
Speed: 3.3MB/s, Total Time: 1.5756(s), Total Bytes: 5459968
Speed: 3.4MB/s, Total Time: 2.106(s), Total Bytes: 7555072
Speed: 3.5MB/s, Total Time: 2.6208(s), Total Bytes: 9650176
Speed: 3.6MB/s, Total Time: 3.16681(s), Total Bytes: 11872256
Speed: 3.6MB/s, Total Time: 3.71281(s), Total Bytes: 14094336
Speed: 3.7MB/s, Total Time: 4.22761(s), Total Bytes: 16189440
Speed: 3.7MB/s, Total Time: 4.75801(s), Total Bytes: 18348032
Speed: 3.7MB/s, Total Time: 5.30401(s), Total Bytes: 20570112
Speed: 3.7MB/s, Total Time: 5.83441(s), Total Bytes: 22792192
Speed: 3.7MB/s, Total Time: 6.36481(s), Total Bytes: 24887296
Speed: 3.7MB/s, Total Time: 6.87961(s), Total Bytes: 26982400
Speed: 3.8MB/s, Total Time: 7.41001(s), Total Bytes: 29140992
Speed: 3.8MB/s, Total Time: 7.92481(s), Total Bytes: 31236096
Speed: 3.8MB/s, Total Time: 8.43961(s), Total Bytes: 33331200
Speed: 3.8MB/s, Total Time: 8.97002(s), Total Bytes: 35489792
Speed: 3.8MB/s, Total Time: 9.51602(s), Total Bytes: 37711872
Speed: 3.8MB/s, Total Time: 10.0464(s), Total Bytes: 39870464
Speed: 3.8MB/s, Total Time: 10.5924(s), Total Bytes: 42092544
Speed: 3.8MB/s, Total Time: 11.1384(s), Total Bytes: 44314624
Speed: 3.8MB/s, Total Time: 11.6844(s), Total Bytes: 46536704
Speed: 3.8MB/s, Total Time: 12.1992(s), Total Bytes: 48631808
Speed: 3.8MB/s, Total Time: 12.714(s), Total Bytes: 50726912
Speed: 3.8MB/s, Total Time: 13.2288(s), Total Bytes: 52822016
Speed: 3.8MB/s, Total Time: 13.7748(s), Total Bytes: 55044096
Speed: 3.8MB/s, Total Time: 14.3208(s), Total Bytes: 57266176
Speed: 3.8MB/s, Total Time: 14.8668(s), Total Bytes: 59488256
Speed: 3.8MB/s, Total Time: 15.3972(s), Total Bytes: 61646848
Speed: 3.6MB/s, Total Time: 16.5672(s), Total Bytes: 61710336
Speed: 3.3MB/s, Total Time: 17.7372(s), Total Bytes: 61837312
Speed: 3.2MB/s, Total Time: 18.6264(s), Total Bytes: 61900800
Speed: 2.9MB/s, Total Time: 20.904(s), Total Bytes: 64059392
Speed: 2.7MB/s, Total Time: 22.2612(s), Total Bytes: 64122880
Speed: 2.7MB/s, Total Time: 23.556(s), Total Bytes: 67043328
Speed: 2.9MB/s, Total Time: 24.0864(s), Total Bytes: 72693760
Speed: 3.2MB/s, Total Time: 24.6168(s), Total Bytes: 83296256
修改发送和接收缓存2048之后的结果。
按照你的那个修改，也是一样的结果，就是
在3.2MB/S之后不动了，持续很长时间了，不动了。
要不你告诉我一下QQ，我加你的QQ，你远程看看我这里怎么回事，我是下载了最新的代码，如果不修改发送缓存，速度还是只有1MB
我是下载了最新的代码。
我的操作系统是windwos7 64位专业版
camke生成的是2013的32位版本，全部都是默认设置。

我qq： 262381263

恩，你们私聊吧

你们私聊吧。这 issue 成聊天室了

@skywind3000 大佬，大哥。借贵地一用啊，主要是更多人讨论，这样方便发现问题，解决问题啊，这样KCP越来越好啊，谢谢老大了。

@halx99 明白了，感谢！
奇怪你的速度怎么这么快？
我以为是我一个人慢，还好，还有另外一个兄台的。

他的测试平台在_nix，作者不是说了_nix平台本地收发不走IP协议栈，直接走快捷通道吗？我理解那个快捷通道应该就是数据在内核中直接复制差不多吧。

实际上，本机传输不管是win还是nix都不走协议栈

同样的代码，nix和windows上本机测试速度差了好几十倍是什么缘故呢。很多人windows本机硬件配置也比阿里的云主机要强吧。至于nix本机收发没走IP协议栈，那是老大说的，我对*nix不熟悉。

刚才试了quic, 内网linux服务测试(调整最大气MTU包大小可以达到200M)
TPS: 2868/sec, QPS:100845/sec  Bytes: 100844 KB/sec, Conn: 2, rtt =    2
TPS: 2852/sec, QPS:100898/sec  Bytes: 100897 KB/sec, Conn: 2, rtt =    2
TPS: 2850/sec, QPS:101435/sec  Bytes: 101434 KB/sec, Conn: 2, rtt =    2
TPS: 2840/sec, QPS:100768/sec  Bytes: 100768 KB/sec, Conn: 2, rtt =    2
TPS: 1466/sec, QPS:51278/sec  Bytes: 51277 KB/sec, Conn: 2, rtt =    2

测试的结果好像是最大的速度确实跟不上啊。好像是和CPU有关吧。。。

测试的结果好像是最大的速度确实跟不上啊。好像是和CPU有关吧。。。

可是本地电脑的cpu比vps主机要强呀，而且本地电脑测试时cpu才占用5%左右。

最新测速结果, kcp.interval=5000:
mtu和wndsize设置:
::ikcp_setmtu(kcp_handle, YASIO_SZ(63, k));
::ikcp_wndsize(kcp_handle, 8192, 8192);

Start trasnfer test via KCP after 170ms...
The sender connected...
Speed: send=4.8Gbits/s recv=3.5Gbits/s, Total Time: 0.500036(s), Total Bytes: send=323344384 recv=322963456
Speed: send=5.6Gbits/s recv=4.7Gbits/s, Total Time: 1.00005(s), Total Bytes: send=752015360 recv=751126528
Speed: send=5.9Gbits/s recv=5.2Gbits/s, Total Time: 1.50006(s), Total Bytes: send=1183479808 recv=1181511680
Speed: send=6.0Gbits/s recv=5.5Gbits/s, Total Time: 2.00007(s), Total Bytes: send=1606182912 recv=1602945024
Speed: send=6.0Gbits/s recv=5.6Gbits/s, Total Time: 2.50008(s), Total Bytes: send=2022346752 recv=2018473984
Speed: send=6.1Gbits/s recv=5.7Gbits/s, Total Time: 3.00013(s), Total Bytes: send=2451398656 recv=2446764032
Speed: send=6.1Gbits/s recv=5.8Gbits/s, Total Time: 3.50022(s), Total Bytes: send=2885910528 recv=2879942656
Speed: send=6.2Gbits/s recv=5.9Gbits/s, Total Time: 4.00025(s), Total Bytes: send=3317121024 recv=3309883392
Speed: send=6.2Gbits/s recv=5.9Gbits/s, Total Time: 4.50027(s), Total Bytes: send=3742744576 recv=3735062528
Speed: send=6.2Gbits/s recv=6.0Gbits/s, Total Time: 5.00041(s), Total Bytes: send=4165955584 recv=4157067264
Speed: send=6.2Gbits/s recv=6.0Gbits/s, Total Time: 5.50046(s), Total Bytes: send=4593420288 recv=4583897088
Speed: send=6.2Gbits/s recv=6.0Gbits/s, Total Time: 6.00046(s), Total Bytes: send=5016313856 recv=5006092288
Speed: send=6.2Gbits/s recv=6.0Gbits/s, Total Time: 6.50054(s), Total Bytes: send=5438763008 recv=5427462144
Speed: send=6.2Gbits/s recv=6.1Gbits/s, Total Time: 7.00055(s), Total Bytes: send=5855053824 recv=5842673664
Speed: send=6.2Gbits/s recv=6.1Gbits/s, Total Time: 7.50061(s), Total Bytes: send=6273058816 recv=6260043776
Speed: send=6.2Gbits/s recv=6.1Gbits/s, Total Time: 8.00069(s), Total Bytes: send=6680461312 recv=6666493952
Speed: send=6.2Gbits/s recv=6.1Gbits/s, Total Time: 8.50075(s), Total Bytes: send=7094720512 recv=7079229440
Speed: send=6.2Gbits/s recv=6.1Gbits/s, Total Time: 9.00082(s), Total Bytes: send=7501678592 recv=7485552640
Speed: send=6.2Gbits/s recv=6.1Gbits/s, Total Time: 9.50089(s), Total Bytes: send=7905652736 recv=7888891904
===> sender finished!
Speed: send=6.2Gbits/s recv=6.1Gbits/s, Total Time: 10.1596(s), Total Bytes: send=8311785472 recv=8311785472

不是吧，我linux上随便写写都能到74.89MB/s，windows就算network stack再怎么不如linux，localhost也不会只有10MB/s吧

不是吧，我linux上随便瞎写buggy code都能到74.89MB/s，windows就算network stack再怎么不如linux，localhost也不会只有10MB/s吧，你一定是哪里写错了 @whrtqa 你要不直接把代码发出来？

估计两个OS本地数据的发送在内核上处理不一样吧，其它的rudp项目，哪怕是商用的，在windows下localhost测试中多是不快，而在nix上是随便GB级别的。感觉nix系统localhost数据不经过网卡，只是内存上复制，而win下经过网卡，受网卡的物理速度限制吧。要不同一代码在两个OS上测试下就清楚了。

我觉得就算是经过网卡也应该没那么慢吧，毕竟一般网卡也能随便到GB级别吧。
我那buggy的代码可能能在windows下运行 buggy benchmark code

我不是实测win已经达到750MB/s了吗，不必怀疑了

我不是实测win已经达到750MB/s了吗，不必怀疑了，lock结贴吧

nix是随便GB级别，哪怕是100Mbps的网卡

我觉得就算是经过网卡也应该没那么慢吧，毕竟一般网卡也能随便到GB级别吧。
我那buggy的代码可能能在windows下运行 buggy benchmark code

同代码在同配置环境下测试不同OS最清楚

各OS下的benchmark: https://github.com/yasio/yasio/blob/master/benchmark.md

OK，既然有结论有代码了，就 lock 掉吧。

authors: Justsoos NobodyXu awc dejing halx99 ktprime skywind3000 whrtqa wineggdrop


text:
Squash Release Candidates into the Release

It would be great if there was an option to squash the 1.0.0-rc.0 and 1.0.0-rc.1 and so on tags into one larger 1.0.0 section of the changelog.

wow, great started

Yes, I also thought about this. But there is no clear behaviour, in which case should we delete postfix, and in which cases not.
So, I decide to not implement such a hard logic, since there 2 good workaround for that case:

remove rc tags from repo. (destructive way)
Use --exclude-tags option  to specify which tags should excluded. (thanks, to @olleolleolle - and #281 PR - now you can do that easily with regex pattern, according your tags style!)

@skywinder would you welcome a PR that included this functionality should I have time to work on it?

@tjsail33

Yes, I can review this PR, but I it should be covered by tests
Please, make this feature not disabled by default, i.e. user have to specify additional key for this feature.

It looks like if you exclude a tag then the features and fixes it contained simply disappear from the timeline. They do not get merged with the following tag as I would expect.
That means if we exclude release candidates then the final release has no changes listed at all.  We do not want to delete those tags, those were actual beta and alpha releases.

@crucialfelix excluded tags shouldn't affect issues. the issues will listed under next release as if that tag doesn't exists.

okay, today I did get that to work. you are correct, it does work. thanks

@crucialfelix :+1:  you are welcome!
@tjsail33 Feel free to reopen this question, if you still have any questions.

source: gharchive/issue

authors: crucialfelix ryanramadhan skywinder tjsail33

repo: skywinder/github-changelog-generator

license: mit

license_type: permissive

license_source: bigquery


text:
Retain cycle between web3 and Eth instances

been profiling my app and found that there is a retain cycle between web3 and Eth instances:

Same Problem? Did you fix it?

license_source: github-api


text:
WARN level logging when text/fallback is missing in chat.* API method calls

Hello, i am currently using Node.js with TypeScript with slack-bolt.
"@slack/bolt": "^3.4.0",
And keep getting this WARN logs in DataDog, it's weird because in chat.postMessage i do have the text argument.
The second log is related to fallback argument, i didn't see this argument in the Slack API documentation, though i tried adding it, but this warning still comes up.

[WARN]  bolt-app The text argument is missing in the request payload for a chat.postMessage call - It's a best practice to always provide a text argument when posting a message. The text is used in places where the content cannot be rendered such as: system push notifications, assistive technology such as screen readers, etc.

[WARN]  bolt-app The fallback argument is missing in the request payload for a chat.postMessage call - It's a best practice to always provide a fallback argument when posting a message. The fallback is used in places where the content cannot be rendered such as: system push notifications, assistive technology such as screen readers, etc.
`

How can i fix this so the warnings don't show up?
Also, i would like to customize the logs, currently the WARN in Datadog is labelled with red color and treated as an error log, i would like to colorize it as yellow, probably add my custom logger (winston/bunyan) to log this? How can i achieve this in slack-bolt?
Thanks in advance.

Hi @erkand-imeri, thanks for asking the question!
The text warning means that your chat.* API method call has only blocks in the parameters. For better user experience, having top-level text as well is highly recommended.
const response = await client.chat.postMessage({
  channel: "C123",
  text: "fallback text message",
  blocks: [ ... ],
});

The fallback warning means that any of your attachments do not have its fallback field for it. For the same reason, having fallback is highly recommended. Can you check the payload that you use for chat.* method API calls in your app?
const response = await client.chat.postMessage({
  channel: "C123",
  text: "fallback text message",
  attachments: [{ blocks: [], fallback: "attachment fallback" }],
});

For your information, here is the logic of the detection: https://github.com/slackapi/node-slack-sdk/blob/%40slack/web-api%406.5.1/packages/web-api/src/WebClient.ts#L643-L664
As for the logger customization, please refer to this document section: https://slack.dev/bolt-js/concepts#logging
You can click "Sending log output somewhere besides the console" to view more details.
Also, the interface to implement is available here: https://github.com/slackapi/node-slack-sdk/blob/%40slack/logger%403.0.0/packages/logger/src/index.ts#L14-L63
I hope this helps!

Hi @seratch thanks a lot for the explanation.

When i add the fallback text then the text is getting displayed on slack thread something which i don't want to, if i leave it as a parameter yet as an empty string i still do get the message.

As for the customization, i tried doing it that, but since i am using TypeScript

What should i do with getLevel, setName and setLevel, i mean i can put ignore for setName and setLevel but getLevel will give me an error no matter what?
    debug: (...msgs) => { logWritable.write('debug: ' + JSON.stringify(msgs)); },     info: (...msgs) => { logWritable.write('info: ' + JSON.stringify(msgs)); },     warn: (...msgs) => { logWritable.write('warn: ' + JSON.stringify(msgs)); },     error: (...msgs) => { logWritable.write('error: ' + JSON.stringify(msgs)); },     setLevel: (level) => { },     getLevel: () => { },     setName: (name) => { },

When i add the fallback text then the text is getting displayed on slack thread something which i don't want to, if i leave it as a parameter yet as an empty string i still do get the message.

You can set " " (a whitespace char in the string) if you don't want to set any meaningful text there.

As for the customization, i tried doing it that, but since i am using TypeScript

You may want to do something similar to the default console logger: https://github.com/slackapi/node-slack-sdk/blob/%40slack/logger%403.0.0/packages/logger/src/index.ts#L68-L151

Thanks @seratch , that worked it looks, but i get the (edited) notification, but it's still a lot better than actual text.

Great to hear that it worked for you! Let us close this issue now.

authors: erkand-imeri seratch

repo: slackapi/bolt-js

license: MIT


text:
Action doesn't send payload if deep link in url prop

Description
Hi, the button doc says If you're using url, you'll still receive an interaction payload it is actually the case except if the value of url is a Slack deep link, so :
{
	"type": "button",
	"text": {
		"type": "plain_text",
		text
	},
	action_id
	url:  `https://mysite.com`
}

sends a payload, but
{
	"type": "button",
	"text": {
		"type": "plain_text",
		text
	},
	action_id
	url:  `slack://app?team=${team_id}&id=${app_id}&tab=message`
}

does not. Is this a bug or a documented behavior or am I missing something to make it work? I am 99% sure it was actually sending a payload last week.
edit: Just upgraded to Bolt 2.0 (congrats for the release :tada:) but the result is the same. I guess it has to do with Slack API?
Thanks for your help.
What type of issue is this? (place an x in one of the [ ])

[ ] bug
[ ] enhancement (feature request)
[x] question
[ ] documentation related
[ ] testing related
[ ] discussion

Requirements (place an x in each of the [ ])

[x] I've read and understood the Contributing guidelines and have done my best effort to follow them.
[x] I've read and agree to the Code of Conduct.
[x] I've searched for any related issues and avoided creating a duplicate issue.

@gterras Thanks for reporting this. I've confirmed a link button with a Slack deep link doesn't send a block_actions event to Slack app's request URL. I will share this feedback with the team concerned.
app.command("/show-buttons", async ({ ack, body }) => {
  const apiAppId = "A12345678";
  const text = {
    "type": "mrkdwn",
    "text": "click the button"
  };
  await ack({
    blocks: [
      {
        "type": "section",
        "text": text,
        "accessory": {
          "type": "button",
          "action_id": "deep-link-test",
          "text": {
            "type": "plain_text",
            "text": "deep link"
          },
          "url": `slack://app?team=${body.team_id}&id=${apiAppId}&tab=message`
        }
      },
      {
        "type": "section",
        "text": text,
        "accessory": {
          "type": "button",
          "action_id": "link-test",
          "text": {
            "type": "plain_text",
            "text": "link"
          },
          "url": "https://slack.com"
        }
      },
      {
        "type": "section",
        "text": text,
        "accessory": {
          "type": "button",
          "action_id": "button-test",
          "text": {
            "type": "plain_text",
            "text": "button"
          },
          "value": "click_me_123",
        }
      }
    ]
  })
});

app.action('deep-link-test', ({ logger, ack }) => {
  logger.info("Deep link clicked!");
  ack()
});
app.action('link-test', ({ logger, ack }) => {
  logger.info("Link clicked!");
  ack()
});
app.action('button-test', ({ logger, ack }) => {
  logger.info("Button clicked!");
  ack()
});
/*
⚡ Bolt app is running!
[INFO]  bolt-app Link clicked!
[INFO]  bolt-app Button clicked!
*/

@gterras (just for your information) After posting the above comment, I realized that I see the issue with my macOS desktop app but don't see it with either browser or iOS app. I will share it with the team as well.

Hi @seratch thanks a lot for your input, indeed it does work in my IOS client but not in my Linux desktop client (4.3.2 and 4.4.0)

I'm closing the issue since it is not really a Bolt concern, I'm in touch with the support team it does seem OS related, thanks for your help @seratch !

FYI I got confirmation from Slack support that this issue was fixed for all OS.

authors: gterras seratch

repo: slackapi/bolt


text:
maven distro of slack-api-client imports okhttp v4.9.3. Should be v4.12.0.

The maven distribution of slack-api-client does not specify/honor some of it dependency versions. So instead of distributing with say okhttp version 4.12.0, it is actually released with okhttp version 4.9.3.
The parent pom.xml defines a property as such:
<okhttp.version>4.12.0</okhttp.version>

But I believe the parent pom.xml also needs "dependencyManagement" to expose those values to submodules.
<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>com.squareup.okhttp3</groupId>
            <artifactId>okhttp</artifactId>
            <version>${okhttp.version}</version>
        </dependency>
    </dependencies>
</dependencyManagement>

or the slack-api-client pom.xml could declare the okhttp.version property there.
Reproducible in:
slack-api-client 1.39.0
The Slack SDK version
com.slack.api:slack-api-client:jar:1.39.0
Java Runtime version
java 17.0.10 2024-01-16 LTS
Java(TM) SE Runtime Environment (build 17.0.10+11-LTS-240)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.10+11-LTS-240, mixed mode, sharing)
OS info
ProductName:		macOS
ProductVersion:		14.4.1
BuildVersion:		23E224
Darwin Kernel Version 23.4.0: Fri Mar 15 00:10:42 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6000
Steps to reproduce:

Import version 1.39.0 of slack-api-client

<dependency>
  <groupId>com.slack.api</groupId>
  <artifactId>slack-api-client</artifactId>
  <version>1.39.0</version>
</dependency>

Compile and run mvn dependencies:tree

Expected result:
I expect to see okhttp version 4.12.0
[INFO] +- com.slack.api:slack-api-client:jar:1.39.0:compile
[INFO] |  +- com.slack.api:slack-api-model:jar:1.39.0:compile
[INFO] |  +- com.squareup.okhttp3:okhttp:jar:4.12.0:compile
  ... snip ...

Actual result:
I see okhttp version 4.9.3.
[INFO] +- com.slack.api:slack-api-client:jar:1.39.0:compile
[INFO] |  +- com.slack.api:slack-api-model:jar:1.39.0:compile
[INFO] |  +- com.squareup.okhttp3:okhttp:jar:4.9.3:compile
[INFO] |  |  +- com.squareup.okio:okio:jar:2.8.0:compile
[INFO] |  |  |  \- org.jetbrains.kotlin:kotlin-stdlib-common:jar:1.6.21:compile
[INFO] |  |  \- org.jetbrains.kotlin:kotlin-stdlib:jar:1.6.21:compile
[INFO] |  |     \- org.jetbrains:annotations:jar:13.0:compile
[INFO] |  +- com.google.code.gson:gson:jar:2.9.1:compile
[INFO] |  \- org.slf4j:slf4j-api:jar:1.7.36:compile

Thanks @seratch. I can confirm that the issue was indeed caused by importing Spring Boot 2.7.18.  After upgrading to Spring Boot 3.2.4, the transitive dependencies were as expected.

repo: slackapi/java-slack-sdk


text:
Add http reply into slack login and slack connection error

Summary
It is quite useful to have these exceptions contain the reply
that caused the failure (especially for example when checking
for a 429 status code and backing off further requests). Right
now it is impossible to determine what the underlying issue
was and react appropriatly to it.
Requirements (place an x in each [ ])

[ x ] I've read and understood the Contributing Guidelines and have done my best effort to follow them.
[ x ] I've read and agree to the Code of Conduct.

 Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.Joshua Harlow seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.You have signed the CLA already but the status is still pending? Let us recheck it.

I signed CLA; not sure how to update this thing though.

source: gharchive/pull-request

authors: CLAassistant harlowja

repo: slackapi/python-slackclient


text:
Slack Config Page Updates

Fixes #35
https://www.loom.com/share/c89ee10d044f4dd38950c2878bfd3e48

Don't send tokens or secrets back down to the client from the API, ever

this does mean that to change one field, you have to have all the values, which seems like an okay compromise to make for now, we could eventually implement a more PATCH-y behavior

update form fields for secrets and tokens to type=password
add working, disabled, error states to the form, show any error from the server in a toast
If configured in environment, only show slack client ID, hide the other form fields
Remove redundant placeholder text like "Enter Slack Client ID" - for User/Bot Token
Re-order form fields to match the order that they are presented in the slack app management UI:

Client ID
Client Secret
User Token
Bot Token

I'm going to use the ordering from this PR in #47 for KOTS as well.

saw that this was approved, I just resolved the conflicts and gave it another look

authors: crdant dexhorthy

repo: slackernews/slackernews


text:
Support functions with no call args and with an asterisk.

select foo(*) from bar also parses, but this is consistent with Presto

Fix for #6

repo: slaclab/lacquer


text:
Add DBT docker image

This feature would add a DBT docker image, which could be referenced in slalom-ggp/dataops-infra and slalom-ggp/dataops-project-template.

Blocked by #18

Resolving. (All commits already merged.)

repo: slalom-ggp/dataops-tools


text:
Delete coalesceSR, coalesceEJ, coalesceTJ

Depends on #3919

From what I saw yesterday, I figured we can also delete a large part of coalesceQC in Coalesce[QScriptCore] here.
We mostly need to keep the LeftShift(Reduce(...), ...)  rewrite since this rewrite removes UnshiftMap. The other rewrites are not doing much and its are green without them..

@jsantos17 agreed, that's exactly what I've already done locally :) PR incoming shortly.

@jsantos17 actually don't merge this PR. The InterpretedRead rewrite isn't getting hit :(

We need to add a test suite to make sure we generate InterpretedRead in cases when we should be. Else it will be all too easy to accidentally introduce regressions.

repo: slamdata/quasar


text:
Possibility to remove unused translations

Motivation
Currently it is possible to get a list of unused translations, but there is no way (as far as I know) to automatically remove those translation strings.
Developer Experience
It would be amazing to be able to run a command locally (similar to apply) to remove all unused translations and also be able to run that in your pipeline to check that there aren't any unused translations.
I guess analyze could be used for the last part already, but it would be nice to get a command similar to a format checker that returns non-zero on changes.

Added in v3.25.0

authors: Tienisto spydon


text:
deprecating \mtrefi*

I realized that \mtrefi* is unnecessary; the functionality can be taken over by \trefi*, if we only allow \mtrefi-like treatment of the first argument. Concretely,

\mtrefi is now deprecated (that should become a warning).
\trefi* and \Trefi* should behave like \mtrefi* did. In particular, no more warning about ? in the first argument.
I have eliminated all \mtrefi* from MathHub.

If we (as we should) switch to reading statements.sty, then implementing \termref correctly should do the trick with no more implementation needed.

repo: slatex/LaTeXML-Plugin-sTeX


text:
Webcam use detection does not appear to work on Windows 11

The indicator is reporting "ON" even after toggling between webcam usage. Other sensors seems to work as before.
Let me know what log/troubleshooting info would be helpful.

A reboot helped resolve. Will reopen if it seems pervasive.

repo: sleevezipper/hass-workstation-service


text:
Add the ability to read a local file

Thought maybe the idea of reading a local text or csv file and reporting.

... together with RegEx to extract data from it...

authors: NODeeJay mukowman


text:
Navigation from right to left

Make slide navigate from right to left
$slidev.nav.next
navigation from left to right by default

$slidev.nav.prev

authors: KermanX amerblackbird

repo: slidevjs/slidev


text:
ServiceWorkerContainer.controller prose says to return undefined, but the IDL doesn't allow that

The IDL says:
readonly attribute ServiceWorker? controller;

and undefined is not a valid ServiceWorker? value.
What you would probably want is for the property to not exist in a secure context at all, right?

We plan to discuss this in web app security WG meeting what the expected behavior for getter in non-secure context should be. I'll update the spec depending on the result.

F2F: update spec. Property won't exist in non-secure contexts

Closed by 5264a72e5336b7440e3a3b3cc9e84c05d3dd3a89

authors: bzbarsky jakearchibald jungkees

repo: slightlyoff/ServiceWorker


text:
Bugfix: Return a list instead of a map for Place.photos

Since Python 3, map() returns a map object which can only be iterated
once: it doesn't makes sense to cache this as a property.

Thanks for this - changes LGTM.
Can you change the destination branch to development and add yourself to the CONTRIBUTORS file?
I'll deal with merging either today or tomorrow and releasing to pypi.

Cool, done! Thanks.

I rebased on development.

Thank you. :)

authors: pjdelport slimkrazy

repo: slimkrazy/python-google-places


text:
get SHAP value for each feature

Is it possible to the SHAP value for each feature?

From the docstrings of the shap_values method, we can see that:
For models with a single output this returns a matrix of SHAP values
(# samples x # features)

So unless you have a different situation/case, you should be getting # samples arrays with SHAP values for each feature when calling this method.
Do let me know if this does not work for you.

Unless I'm mistaken, you can simply average over the SHAP values for each sample for each feature. e.g. here's a snippet:
mean_shap_feature_values = pd.DataFrame(shap_values, columns=your_xs_dataframe.columns).abs().mean(axis=0).sort_values(ascending=False)
These should align with your simple SHAP importance plot (summary_plot with plot_type='bar').

Yes, the averaging of absolute values will give you desired answer.
@thatlittleboy Candidate for closing.

authors: No-Stream alexlaurence detrin ibuda

repo: slundberg/shap


text:
Add mic passthrough

Allow user to add their microphone and mix it with soundboard

[x] Create checkbox if user want to mix mic or only output sound effects through audio device
[x] Figure how to listen to their mic
[x] Mix it with audio
[x] Output through selected audio device

It's possible that user will need to create virtual audio input (ex.: VB-Cable or any other solution)
Connected with #16

Will be added in 1.1.0

repo: smaartscz/smaart-soundboard


text:
Subsync erroring out with "max() arg is an empty sequence".

Environment (please complete the following information):

OS: Ubuntu 18.04 LTS
python version: Python 2.7.17
subsync version: subsync 0.3.4

Describe the bug
The sync process fails with an error ValueError: max() arg is an empty sequence
To Reproduce
subsync "vid.mp4" -i sub1.srt -o sub2.srt
Expected behavior
The process should succeed.
Output
INFO:subsync.subsync:extracting speech segments from reference 'vid.mp4'...
INFO:subsync.speech_transformers:Checking video for subtitles stream...
INFO:subsync.speech_transformers:Video file appears to lack subtitle stream
100%|█████████▉| 7687.72266667/7687.723 [01:33<00:00, 81.91it/s]
INFO:subsync.subsync:...done
INFO:subsync.subsync:extracting speech segments from subtitles 'sub1.srt'...
INFO:subsync.subtitle_parser:detected encoding: UTF-8
INFO:subsync.subsync:...done
INFO:subsync.subsync:computing alignments...
Traceback (most recent call last):
  File "/home/user/.local/bin/subsync", line 11, in <module>
    load_entry_point('subsync==0.3.4', 'console_scripts', 'subsync')()
  File "/home/user/.local/lib/python2.7/site-packages/subsync/subsync.py", line 207, in main
    return run(args)
  File "/home/user/.local/lib/python2.7/site-packages/subsync/subsync.py", line 106, in run
    srt_pipes,
  File "/home/user/.local/lib/python2.7/site-packages/sklearn/base.py", line 467, in fit_transform
    return self.fit(X, y, **fit_params).transform(X)
  File "/home/user/.local/lib/python2.7/site-packages/subsync/aligners.py", line 77, in transform
    (score, offset), subpipe = max(scores)
ValueError: max() arg is an empty sequence

Test case
vid.zip
Additional context
--

Thanks for submitting an issue! Could you repeat the full command with the --make-test-case flag?
subsync "vid.mp4" -i sub1.srt -o sub2.srt --make-test-case
It will generate a tarball that also includes the subtitles, which are also needed to debug.

I've had the same issue with SRT-only realignement.
The test case is in the attached file.
Happy.Hour.2015.ENG.zip

Ugh, I just realized that this exception is probably interfering with test case generation, which is maybe why the zips you all are uploading don't include them. So that's another bug I should fix first...

Let me fix #61 and ask for new test cases once I push a fix...

@smacke you're right. The test cases were only producing the .npy files.

testfile-max.zip
Error message:
INFO:ffsubsync.subtitle_parser:detected encoding: WINDOWS-1252
INFO:ffsubsync.subsync:...done
INFO:ffsubsync.subsync:computing alignments...
Traceback (most recent call last):
  File "/home/torstein/.local/bin/ffsubsync", line 11, in <module>
    load_entry_point('ffsubsync==0.3.7', 'console_scripts', 'ffsubsync')()
  File "/home/torstein/.local/lib/python3.6/site-packages/ffsubsync/subsync.py", line 208, in main
    return run(args)
  File "/home/torstein/.local/lib/python3.6/site-packages/ffsubsync/subsync.py", line 106, in run
    srt_pipes,
  File "/home/torstein/.local/lib/python3.6/site-packages/sklearn/base.py", line 693, in fit_transform
    return self.fit(X, y, **fit_params).transform(X)
  File "/home/torstein/.local/lib/python3.6/site-packages/ffsubsync/aligners.py", line 77, in transform
    (score, offset), subpipe = max(scores, key=lambda x: x[0][0])
ValueError: max() arg is an empty sequence

Kung Fury (2015).zip
INFO:ffsubsync.subsync:extracting speech segments from reference 'Kung.Fury.mp4'...
INFO:ffsubsync.speech_transformers:Checking video for subtitles stream...
INFO:ffsubsync.speech_transformers:Video file appears to lack subtitle stream
100%|██████████████████████████████| 1862.368/1862.368 [00:03<00:00, 504.19it/s]
INFO:ffsubsync.subsync:...done
INFO:ffsubsync.subsync:serializing speech...
INFO:ffsubsync.subsync:...done
INFO:ffsubsync.subsync:extracting speech segments from subtitles '/opt/Kung Fury (2015).en.srt'...
INFO:ffsubsync.subtitle_parser:detected encoding: UTF-8
INFO:ffsubsync.subsync:...done
INFO:ffsubsync.subsync:computing alignments...
Traceback (most recent call last):
  File "/home/user/.local/bin/ffsubsync", line 8, in <module>
    sys.exit(main())
  File "/home/user/.local/lib/python3.8/site-packages/ffsubsync/subsync.py", line 208, in main
    return run(args)
  File "/home/user/.local/lib/python3.8/site-packages/ffsubsync/subsync.py", line 102, in run
    offset_samples, best_srt_pipe = MaxScoreAligner(
  File "/home/user/.local/lib/python3.8/site-packages/sklearn/base.py", line 693, in fit_transform
    return self.fit(X, y, **fit_params).transform(X)
  File "/home/user/.local/lib/python3.8/site-packages/ffsubsync/aligners.py", line 77, in transform
    (score, offset), subpipe = max(scores, key=lambda x: x[0][0])
ValueError: max() arg is an empty sequence

Hi everyone, the underlying cause of this issue is when ffsubsync can't find a good sync (it tries a number of alternatives, but if it doesn't consider any of them "good", then there are 0 to pick from, hence the empty sequence). Version 0.4.0 (now on PyPI) gives a more informative error message that suggests a possible workaround, but unfortunately it's far from guaranteed to work.
For the record, this error will now manifest itself via the following output:
ERROR:ffsubsync.ffsubsync:Synchronization failed; consider passing --max-offset-seconds with a number larger than 600
The suggestion may or may not work (likely will not; it's not common to have shifts larger than 10 minutes, though it is possible).
In my experience these are cases that are very difficult for the algorithm, either because they involve breaks / splits, or because the speech detection gives results that are too noisy. Please keep the test cases coming though! They will help me as I make improvements.

authors: Eideen Glandos PaulinoRBJ interlark smacke

repo: smacke/subsync


text:
At preview Cache

Features:

ability to save to cache values for @commands in preview
cache is cleared when running at commands with preview=false; message with no at commands would work as well

Why:

commands in preview are executing each time user adds a new symbol to the text. So, commands like @web should be cached if fetch was a success.

merged

authors: olegklimov valaises

repo: smallcloudai/refact-lsp


text:
vs-code plugin uses wrong adress

I'm on  ubuntu using vscode. Since today refact.ai stopped working as it does not use my custom configured endpoint (settings/Adress URL). It uses 127.0.0.1:9095 instead.
The picture below shows the refact.ai plugin release date + the error message.
The version of the plugin is v5.0.100
VSCode version is 1.93.1

Probably 105 from yesterday, not 100, that's a pre-release for experimentation. Thanks for testing!!! If you want trouble-free experience, use the stable version. What you are seeing is probably dead refact-lsp process (that's what it is connecting to via 127.0.0.1:9095). Good commands to investigate more:
ps aux | grep refact.lsp
tail -n 1000 -f ~/.cache/refact/logs/rustbinary.2024-09-26
(current date)

Thx for the response. I'm using a stable version.
It seems like the error message is confusing. When i checked the logs it was clear that the server was not reachable on the configured address.
2024-10-09T07:11:02.678127Z  INFO refact_lsp::caps:318: fetching caps from http://XXXXXXX:5000/refact-caps
2024-10-09T07:11:08.932042Z ERROR refact_lsp::global_context:187: caps fetch failed: "error sending request for url (http://XXXXXXX:5000/refact-caps): connection error: Connection reset by peer (os error 104)"

It seems the popup show an invalid ip address but under the hood the correct one is used.

authors: Equanox olegklimov

repo: smallcloudai/refact-vscode


text:
Updated home screen

Improved home screen.
@smaranjitghose

Removed Network Image and added AssetImage with images saved in assets
Added speech recognition and convert into text in the search bar
Added android.permission.RECORD_AUDIO and android.permission.INTERNET for speech recognition
Changed minSdkVersion to 21 for using speech_to_text package
Changed BoxShadow as mentioned

Share the screen shot please

Share the screen shot please

Check the PR and files changed.


text:
Fix ci-sonarqube-ts input format

fix input format by using ${{ }} everywhere https://github.com/smartcontractkit/.github/pull/472#discussion_r1662637659
I hadn't noticed this in my previous PR that test artifacts generated weren't downloaded properly because they were in a different workflow. Added support for downloading artifacts from different workflows.
Tested in ci-sonarqube action

ooh I forgot - could you add a changeset?

ooh I forgot - could you add a changeset?

I forget it everytime, my bad. I've added the changeset now, PTAL


text:
[Bug]: ZSH shell on linux deploy scripts not working

Describe the bug
So there's 3 different bugs that I'm facing
What I did is run the script and also echo out the command from the deploy script

No constructor
Contract isn't deploying as it expects --constructor-args
forge create ./src/${Test}.sol:${Test} -i --rpc-url $rpc --constructor-args

Constructor present 1 parameter
This works perfectly
forge create ./src/${Test}.sol:${Test} -i --rpc-url $rpc --constructor-args 10

Constructor present >1 parameters
Only the first parameter gets passed
forge create ./src/${Test}.sol:${Test} -i --rpc-url $rpc --constructor-args 10

To Reproduce
in the describe the bug
Expected behavior
Deployed contracts
Additional context
I think it could be due to
read -ra args
and adding a length check for args to differentiate error case 1 from 2 and 3

alright i got it to work for me, not sure if this is a me problem or not i had the same error on gitpod and on my local  repository with the fix (https://github.com/shankars99/foundry-starter-kit)
the other change required to reproduce would be
npm i hardhat
npx hardhat node
and then
url: "https://localhost:8545" in hardhat.config.js
can i make a PR for it?

Please!

repo: smartcontractkit/foundry-starter-kit


text:
Lesson 11: ImportError: cannot import name 'LinkToken' from 'brownie'

When I try to run brownie run scripts/advanced_collectible/deploy_and_create.py in the terminal I get returned:

ImportError: cannot import name 'LinkToken' from 'brownie'

I've uninstalled and reinstalled brownie, closed and reopened the terminal and vscode, and deleted my build folder and recompiled.
I've also copy and pasted directly over my code from Patrick's github nft-mix and the error still pops up.
Any help would be greatly appreciated!

Hello @RohanNero
Do you have the link token mock on the test folder?
you can get it from chainlink-mix.

Hello @cromewar,
I just copied and pasted the files from inside the tests folder and the error is still popping up.

@RohanNero Do you have the init.py file?

I had forgotten to copy over the Mock contracts into the test_contracts folder. Sorry my brain is a little over-cooked.

authors: RohanNero cromewar ptn77


text:
Lesson 7: Smart Contract Lottery. Random number not generated in Rinkeby network

Following the video, I was playing with random number on Remix following chainlink offical website's example https://docs.chain.link/docs/get-a-random-number/
I could get a random number on Kovan network in about 50s. However, after switching to Rinkeby and replacing LINK Token address, VRF Coordinator address and KeyHash, I couldn't receive random number even after 10mins.
Does someone else have similar issue at the moment?

I stumbled upon the same thing a couple of days ago. NEWS FLASH : The chainlink node on rinkeby is taking at least 26-30 minutes to return a random value which is too high for me, to avoid this I have started deploying on kovan and there it takes merely a minute to get the random value. You still wanna deploy on rinkeby? Change time.sleep to time.sleep(1560).

Super helpful, thanks for sharing your experience! Just want to make sure it is not a unique problem for me, when Patrick in the video deployed the contract to Rinkeby, that seems to be a quick return from the VRF.


text:
Proper way to add additional packages to the virtualenv?

Great role! I'm using it as a base for my house's mycroft deployment.
I would like to use the mimic3 TTS plugin, which requires installing some deps in the virtualenv. I looked through the role code, but don't see an easy extension point.
Is this possible as is (or is this a feature request)?

Hi @Ramblurr,
I added the mycroft_pip_custom_libraries variables which is a YAML list, you should be able to add Python libraries fron PyPi or git.

authors: Ramblurr goldyfruit

repo: smartgic/ansible-role-mycroft


text:
🛑 home_hh is down

In 1cf12bf, home_hh (https://$HH) was down:

HTTP code: 0
Response time: 0 ms

Resolved: home_hh is back up in 0695177 after 12 minutes.


text:
[DateHistogram] Fix key timestamp bug

[DateHistogram] Fix key timestamp bug

Warnings

:warning:
You should add at least 1 more reviewer to the PR

:warning:

Branch being merged does not follow Git Flow

:warning:
The README has not been updated. Please update the README.

Messages

:book:
Could not find any browser results.

:book:
We were able to automatically fix some formatting issues in this PR for you!

Some things that were possibly fixed:

Code that could be fixed via the --fix flag
Formatting that could be fixed by prettier

Take a look at this commit to see what happened in detail: e20bdec4fec7dfac2efcb68c97e6934cff83819a
And look at this wiki page to see the reasoning behind the ESLint rules: https://github.com/smartprocure/eslint-config-smartprocure/wiki/Rules-and-Why-We-Chose-Them

  Generated by :no_entry_sign: dangerJS against 835adf812223cb6f290889a457915497b68f62f5

repo: smartprocure/contexture-mongo


text:
chore(main): release 0.10.1

:robot: I have created a release beep boop
0.10.1 (2024-06-29)
Bug Fixes

BaseLambda optional type parameter (b0c14ca)

This PR was generated with Release Please. See documentation.

:robot: Created releases:

v0.10.1
:sunflower:

repo: smartstream-tv/pulumi-aws-toolbox


text:
Crash mid run of a small DB

Hi,
please see the attached crash log. the data is from a sample from teeth, searched against a small protein dataset, with GPTMD followed by the search. the search stage crashed.
Thanks!
David.
results.txt

are you willing to let us have a go?

sure. I will prepare a folder in the box

maybe the raw file is still loading?
i see fasta only

working on fix here: https://github.com/smith-chem-wisc/MetaMorpheus/pull/2453
Bug created by attempted addition of modification to a peptidewithsetmods that already had a modification at the same position

Thanks!
From: trishorts @.>
Sent: Friday, December 13, 2024 8:18 PM
To: smith-chem-wisc/MetaMorpheus @.>
Cc: David Morgenstern @.>; Author @.>
Subject: Re: [smith-chem-wisc/MetaMorpheus] Crash mid run of a small DB (Issue #2450)
Caution: External Sender. Do not click on links or open attachments unless you recognize the sender.
working on fix here: #2453https://github.com/smith-chem-wisc/MetaMorpheus/pull/2453
Bug created by attempted addition of modification to a peptidewithsetmods that already had a modification at the same position
—
Reply to this email directly, view it on GitHubhttps://github.com/smith-chem-wisc/MetaMorpheus/issues/2450#issuecomment-2542005160, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AIQ5VIJYPOXSXAAGYWAEK5T2FMQF7AVCNFSM6AAAAABTQOUZGGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNBSGAYDKMJWGA.
You are receiving this because you authored the thread.Message ID: @.@.>>

authors: Dmorgen trishorts

repo: smith-chem-wisc/MetaMorpheus


text:
[Looking for Contributor] New Provider: OpenAssistant

in #32 we added Provider modules to make it easy to add more chats. if you're new here and want an easy way to contribute, now it's a lot easier!
please claim this and send a PR for us to review!
this work is split out from #13

I took a crack at this and got it working, just need to go back over the styles and target more specifically instead of hitting dynamic classes. Also, it would be good to figure out better specificity instead of using !important, but overall I think it looks pretty good. Could have it cleaned up and done tomorrow. Never contributed to open source before so let me know how this works with assigning issues. Very cool and useful tool though, thanks for the opportunity.

Sounds great! Thanks @michael-schienbein-fhr — just open a PR from your forked branch into our upstream main branch. You can assign me and/or @swyxio and we will take a look! Appreciate your help!

you got this michael!

repo: smol-ai/menubar


text:
how to access phpmyadmin on heroku

I deployed my app having Mysql database on Heroku.
I have added phpmyadmin using composer.json to app.
How can I access phpmyadmin ?

where to provide cleardb url?

Closing per comment in #2. Make a PR if you can provide comments clarifying how to get this going for others

authors: smsaladi vbhusan


text:
Brew Install Error

mymac ~ % brew install smudge/smudge/nightlight
Error: Git is unavailable

Any luck here? Did you run brew install git first, and are you able to run other git commands?
If you can't get it working, it would be better to open a new issue over in this repo:
https://github.com/smudge/homebrew-smudge/
The formula in question is here:
https://github.com/smudge/homebrew-smudge/blob/master/Formula/nightlight.rb

authors: bluecursor smudge

repo: smudge/nightlight