原代码如下
$len = fwrite($this->_socket, $this->_sendBuffer, 8192);
.
.
.
if ($len > 0) {
$this->bytesWritten += $len;
$this->_sendBuffer = substr($this->_sendBuffer, $len);
} else {
self::$statistics['send_fail']++;
$this->destroy();
}
当$len为false时,会不会只是客服端shutdown了接收,这时直接把整个连接destroy掉,是不是不妥
workerman里不支持半关闭。