Skip to content

Commit 81d322c

Browse files
committed
Improve documentation
1 parent 6e9475c commit 81d322c

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,8 @@ $proxy->connect('tcp://smtp.googlemail.com:587')->then(function (React\Socket\Co
170170
$connection->on('data', function ($chunk) use ($connection) {
171171
echo $chunk;
172172
});
173+
}, function (Exception $e) {
174+
echo 'Error: ' . $e->getMessage() . PHP_EOL;
173175
});
174176
```
175177

@@ -189,6 +191,8 @@ $connector->connect('tcp://smtp.googlemail.com:587')->then(function (React\Socke
189191
$connection->on('data', function ($chunk) use ($connection) {
190192
echo $chunk;
191193
});
194+
}, function (Exception $e) {
195+
echo 'Error: ' . $e->getMessage() . PHP_EOL;
192196
});
193197
```
194198

@@ -215,6 +219,8 @@ $connector->connect('tls://smtp.googlemail.com:465')->then(function (React\Socke
215219
$connection->on('data', function ($chunk) use ($connection) {
216220
echo $chunk;
217221
});
222+
}, function (Exception $e) {
223+
echo 'Error: ' . $e->getMessage() . PHP_EOL;
218224
});
219225
```
220226

@@ -247,7 +253,7 @@ $browser->get('https://example.com/')->then(function (Psr\Http\Message\ResponseI
247253
```
248254

249255
See also [ReactPHP's HTTP client](https://github.com/reactphp/http#client-usage)
250-
and any of the [examples](examples) for more details.
256+
and any of the [examples](examples/) for more details.
251257

252258
#### Connection timeout
253259

@@ -275,6 +281,8 @@ $connector = new React\Socket\Connector(array(
275281

276282
$connector->connect('tcp://google.com:80')->then(function ($connection) {
277283
// connection succeeded within 3.0 seconds
284+
}, function (Exception $e) {
285+
echo 'Error: ' . $e->getMessage() . PHP_EOL;
278286
});
279287
```
280288

@@ -412,6 +420,8 @@ $proxy = new Clue\React\HttpProxy\ProxyConnector('http+unix:///tmp/proxy.sock');
412420

413421
$proxy->connect('tcp://google.com:80')->then(function (React\Socket\ConnectionInterface $connection) {
414422
// connected…
423+
}, function (Exception $e) {
424+
echo 'Error: ' . $e->getMessage() . PHP_EOL;
415425
});
416426
```
417427

0 commit comments

Comments
 (0)