请问在Workerman的TcpConnection中,当write失败时,直接把类destroy了,是否不妥

xxfxxfxxfxxf

原代码如下
$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掉,是不是不妥

1486 1 0
1个回答

walkor

workerman里不支持半关闭。

  • 暂无评论
年代过于久远,无法发表回答
🔝