Skip to content

Commit

Permalink
handle closing connections
Browse files Browse the repository at this point in the history
  • Loading branch information
joedixon committed Nov 15, 2023
1 parent a11be65 commit 73af447
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/HttpServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function __invoke(ConnectionInterface $connection)
$connection->on('data', function ($data) use ($connection) {
$this->handleRequest($data, $connection);
});
// $conn->on('close', function () use ($conn) {
// $connection->on('close', function () use ($connection) {
// $this->handleEnd($conn);
// });
// $conn->on('error', function (\Exception $e) use ($conn) {
Expand Down Expand Up @@ -66,6 +66,7 @@ protected function handleRequest(string $data, Conn $connection)
$server->open($reverbConnection);

$connection->on('message', fn (string $message) => $server->message($reverbConnection, $message));
$connection->on('close', fn () => $server->close($reverbConnection));

return;
}
Expand Down

0 comments on commit 73af447

Please sign in to comment.