Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/ChromeDevtoolsProtocol/WebSocket/WebSocketClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,16 @@ public function setDeadline(?\DateTimeImmutable $deadline)
$this->socket->setDeadline($deadline);
}

public function receive()
{
// Forward the receive() call to Client::receive()
$payloads = parent::receive();

// If the latest payload(s) are received, clear the buffer. We don't need that copy any more.
if ($payloads)
$this->received = array();

// Return the latest received payloads
return $payloads;
}
}