在 TcpConnection 類(lèi)的 pipe 方法中
$this->onClose = function ($source) use ($dest) {
$dest->destroy();
};
這里如果 pipe 兩端的網(wǎng)速差別較大, $source 在發(fā)送完數(shù)據(jù)后 close(), 而 $dest 尚未 send 完成就直接 destroy(), 會(huì)丟失數(shù)據(jù).
這里的 destroy() 是否應(yīng)當(dāng)改為 close() 更合適?