Fix SocketClient checking for more data, now that we buffer received data

This commit is contained in:
2023-06-16 23:18:35 +10:00
parent ade5f07e37
commit b41d65a8fd
2 changed files with 25 additions and 6 deletions

View File

@@ -502,7 +502,7 @@ final class SocketClient {
}
/**
* See if we there is data waiting to collect, or if we can send
* See if there is data waiting to collect, or if we can send
*
* @param bool $read
* @param bool $write
@@ -512,6 +512,9 @@ final class SocketClient {
*/
public function ttySelect(bool $read,bool $write, int $timeout): int
{
if (strlen($this->rx_buf) && ($this->rx_left))
return 1;
$read = $read ? [$this->connection] : NULL;
$write = $write ? [$this->connection] : NULL;