tcpsock:send的文档提到“ This method is a synchronous operation that will not return until all the data has been flushed into the system socket send buffer or an error occurs ”
如果刚好系统缓冲区满导致本次需要发送的数据不能完全放到系统的缓冲区里,会导致:
1.阻塞返回?感觉这个不可能吧?
2.如果是非阻塞,则应该会返回已经存到系统缓冲区的bytes吧?如果是这样,lua代码里需要怎样来保证把剩余的数据发出去。while应该不是一个好主意。看了目前的一些lua-resty-*,都没有为此加入特殊处理代码。