File tree Expand file tree Collapse file tree 3 files changed +21
-5
lines changed
Expand file tree Collapse file tree 3 files changed +21
-5
lines changed Original file line number Diff line number Diff line change @@ -116,10 +116,18 @@ you can use any of its events and methods as usual:
116116
117117``` php
118118$connection->on('data', function ($chunk) {
119- echo $data ;
119+ echo $chunk ;
120120});
121121
122- $conenction->on('close', function () {
122+ $connection->on('end', function () {
123+ echo 'ended';
124+ });
125+
126+ $connection->on('error', function (Exception $e) {
127+ echo 'error: ' . $e->getMessage();
128+ });
129+
130+ $connection->on('close', function () {
123131 echo 'closed';
124132});
125133
Original file line number Diff line number Diff line change 77 "php" : " >=5.3.0" ,
88 "react/dns" : " 0.4.*|0.3.*" ,
99 "react/event-loop" : " 0.4.*|0.3.*" ,
10- "react/stream" : " ^0.4.5" ,
10+ "react/stream" : " ^0.6 || ^0.5 || ^0. 4.5" ,
1111 "react/promise" : " ^2.1 || ^1.2" ,
1212 "react/promise-timer" : " ~1.0"
1313 },
Original file line number Diff line number Diff line change 2929 *
3030 * ```php
3131 * $connection->on('data', function ($chunk) {
32- * echo $data ;
32+ * echo $chunk ;
3333 * });
3434 *
35- * $conenction->on('close', function () {
35+ * $connection->on('end', function () {
36+ * echo 'ended';
37+ * });
38+ *
39+ * $connection->on('error', function (Exception $e) {
40+ * echo 'error: ' . $e->getMessage();
41+ * });
42+ *
43+ * $connection->on('close', function () {
3644 * echo 'closed';
3745 * });
3846 *
You can’t perform that action at this time.
0 commit comments