Changeset View
Changeset View
Standalone View
Standalone View
src/channel/PhutilSocketChannel.php
Show First 20 Lines • Show All 126 Lines • ▼ Show 20 Lines | /* -( Construction )------------------------------------------------------- */ | ||||
} | } | ||||
protected function writeBytes($bytes) { | protected function writeBytes($bytes) { | ||||
$socket = $this->writeSocket; | $socket = $this->writeSocket; | ||||
if (!$socket) { | if (!$socket) { | ||||
return 0; | return 0; | ||||
} | } | ||||
$len = @fwrite($socket, $bytes); | $len = phutil_fwrite_nonblocking_stream($socket, $bytes); | ||||
if ($len === false) { | if ($len === false) { | ||||
$this->closeWriteSocket(); | $this->closeWriteSocket(); | ||||
return 0; | return 0; | ||||
} | } | ||||
return $len; | return $len; | ||||
} | } | ||||
protected function getReadSockets() { | protected function getReadSockets() { | ||||
▲ Show 20 Lines • Show All 52 Lines • Show Last 20 Lines |