Skip to content

Commit

Permalink
Merge pull request #1037 from ywisax/patch-2
Browse files Browse the repository at this point in the history
Allow set `$raw` in send method when pipe connection
  • Loading branch information
walkor authored Jun 4, 2024
2 parents ac27d37 + 27d5d13 commit 4b35b7e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Connection/TcpConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -777,13 +777,14 @@ public function doSslHandshake($socket){
* This method pulls all the data out of a readable stream, and writes it to the supplied destination.
*
* @param self $dest
* @param bool $raw
* @return void
*/
public function pipe(self $dest)
public function pipe(self $dest, $raw = false)
{
$source = $this;
$this->onMessage = function ($source, $data) use ($dest) {
$dest->send($data);
$this->onMessage = function ($source, $data) use ($dest, $raw) {
$dest->send($data, $raw);
};
$this->onClose = function ($source) use ($dest) {
$dest->close();
Expand Down

0 comments on commit 4b35b7e

Please sign in to comment.