Skip to content

Commit

Permalink
Allow set $raw in send method when pipe connection
Browse files Browse the repository at this point in the history
  • Loading branch information
ywisax authored Jun 3, 2024
1 parent ac27d37 commit 27d5d13
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 27d5d13

Please sign in to comment.