@@ -295,6 +295,25 @@ $connector->connect('localhost:80')->then(function (ConnectionInterface $connect
295295});
296296```
297297
298+ By default, the ` tcp:// ` and ` tls:// ` URI schemes will use timeout value that
299+ repects your ` default_socket_timeout ` ini setting (which defaults to 60s).
300+ If you want a custom timeout value, you can simply pass this like this:
301+
302+ ``` php
303+ $connector = new Connector($loop, array(
304+ 'timeout' => 10.0
305+ ));
306+ ```
307+
308+ Similarly, if you do not want to apply a timeout at all and let the operating
309+ system handle this, you can pass a boolean flag like this:
310+
311+ ``` php
312+ $connector = new Connector($loop, array(
313+ 'timeout' => false
314+ ));
315+ ```
316+
298317By default, the ` Connector ` supports the ` tcp:// ` , ` tls:// ` and ` unix:// `
299318URI schemes. If you want to explicitly prohibit any of these, you can simply
300319pass boolean flags like this:
@@ -357,9 +376,11 @@ $unix = new UnixConnector($loop);
357376
358377$connector = new Connector($loop, array(
359378 'tcp' => $tcp,
360- 'dns' => false,
361379 'tls' => $tls,
362380 'unix' => $unix,
381+
382+ 'dns' => false,
383+ 'timeout' => false,
363384));
364385
365386$connector->connect('google.com:80')->then(function (ConnectionInterface $connection) {
@@ -377,6 +398,8 @@ $connector->connect('google.com:80')->then(function (ConnectionInterface $connec
377398 TCP/IP connection before enabling secure TLS mode. If you want to use a custom
378399 underlying ` tcp:// ` connector for secure TLS connections only, you may
379400 explicitly pass a ` tls:// ` connector like above instead.
401+ Internally, the ` tcp:// ` and ` tls:// ` connectors will always be wrapped by
402+ ` TimeoutConnector ` , unless you disable timeouts like in the above example.
380403
381404## Advanced Usage
382405
0 commit comments