Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

建议框架提供 “手动Recv" 的接收模式 #65

Open
gmxyb opened this issue Apr 15, 2019 · 0 comments
Open

建议框架提供 “手动Recv" 的接收模式 #65

gmxyb opened this issue Apr 15, 2019 · 0 comments

Comments

@gmxyb
Copy link

gmxyb commented Apr 15, 2019

这套框架非常优秀,感谢作者辛勤付出~!

这里提个小意见:目前情况下,数据接收是由框架内部自动发起的,数据到达后触发OnReceived事件交给应用程序,这样一来,应用程序没办法根据需要进行细粒度的控制(只能照单全收)。希望框架能提供一种由程序"手动接收“的模式,按需要发起接收请求,这样可以充分利用TCP自带的的流控机制。

手动接收的使用场景:比如写一个反向代理服务器,服务端接入客户端连接后,收取少量的数据,然后发起Connect到后端服务器,转发客户端的数据,但Connect是异步的,无法确定要多久,在此期间客户端可能会持续发送而造成服务端需要缓存大量数据,这时候就希望能够 ”暂停接收“ 客户端数据,等到Connect成功后再 ”继续接收“。

上述场景下,如果有”手动接收“机制,能够完美解决。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant