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

boost async_write_some可否用async_write替换 #224

Open
chukeer opened this issue Jan 20, 2018 · 1 comment
Open

boost async_write_some可否用async_write替换 #224

chukeer opened this issue Jan 20, 2018 · 1 comment

Comments

@chukeer
Copy link

chukeer commented Jan 20, 2018

async_write_some不保证数据会写完,需要调用者在回调里判断数据是否发生完整

async_write保证在回调发生的时候数据全部写入tcp缓冲区,所以使用async_write是不是可以让代码更简洁一些

@LazyPlanet
Copy link

理论上是的,async_write的底层实现就是采用的async_write_some多次发送,知道发送成功。

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

2 participants