skynet如何进行流量控制? #1917
Unanswered
chengf2018
asked this question in
Q&A
skynet如何进行流量控制?
#1917
Replies: 3 comments
-
|
流量控制指的是read的流量,不是write的 |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
可以考虑在应用层read后弄一个滑动窗口统计收到的字节数,当速率大于你设定的速率时,就调用socket.pause,可以参考skynet的socket.lua自身源码中对pause和resume的实现,只不过其仅按缓冲区大小来控制的。 |
Beta Was this translation helpful? Give feedback.
0 replies
-
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
看了skynet提供了pause/resume机制,但是如何精确的控制socket的流量呢?
例如:将socket控制在每秒不超过1024kb。
Beta Was this translation helpful? Give feedback.
All reactions