原代碼如下
$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();
}
當(dāng)$len為false時,會不會只是客服端shutdown了接收,這時直接把整個連接destroy掉,是不是不妥