baidu / sofa-pbrpc

A light-weight RPC implement of google protobuf RPC framework.
Other
2.13k stars 655 forks source link

boost async_write_some可否用async_write替换 #224

Open chukeer opened 6 years ago

chukeer commented 6 years ago

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

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

LazyPlanet commented 5 years ago

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