原代碼如下
$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時(shí),會(huì)不會(huì)只是客服端shutdown了接收,這時(shí)直接把整個(gè)連接destroy掉,是不是不妥