Skip to content

Commit 3af4268

Browse files
author
Johannes Tiefenbrunner
committed
Emit close with reason 1006 to WebSocketConnection listeners when underlying stream emitted a close.
1 parent 4048dc4 commit 3af4268

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/WebSocketConnection.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ function (Frame $frame) {
6868
$this->messageBuffer = $mb;
6969

7070
$stream->on('data', [$mb, 'onData']);
71+
$stream->on('close', function () {
72+
$this->emit('close', [1006, $this, '']);
73+
});
7174
}
7275

7376
public function send($data)

0 commit comments

Comments
 (0)