-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2816f91
commit c4eed24
Showing
2 changed files
with
42 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
/** | ||
* This file is part of Hyperf. | ||
* | ||
* @link https://www.hyperf.io | ||
* @document https://hyperf.wiki | ||
* @contact [email protected] | ||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE | ||
*/ | ||
namespace Hyperf\Engine\Http; | ||
|
||
use Hyperf\Engine\Contract\Http\ConnectionInterface; | ||
use Swoole\Http\Response; | ||
|
||
class Connection implements ConnectionInterface | ||
{ | ||
public function __construct(protected Response $response) | ||
{ | ||
} | ||
|
||
public function write(string $data): bool | ||
{ | ||
return $this->response->write($data); | ||
} | ||
|
||
/** | ||
* @return Response | ||
*/ | ||
public function getSocket(): mixed | ||
{ | ||
return $this->response; | ||
} | ||
|
||
public function end(?string $content = null): bool | ||
{ | ||
return $this->response->end($content); | ||
} | ||
} |