Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/01-http.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
// time out connection attempt in 3.0s
$dns = new TimeoutConnector($dns, 3.0, $loop);

$dns->create('www.google.com', 80)->then(function (ConnectionInterface $connection) {
$dns->connect('www.google.com:80')->then(function (ConnectionInterface $connection) {
$connection->on('data', function ($data) {
echo $data;
});
Expand Down
2 changes: 1 addition & 1 deletion examples/02-https.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// time out connection attempt in 3.0s
$tls = new TimeoutConnector($tls, 3.0, $loop);

$tls->create('www.google.com', 443)->then(function (ConnectionInterface $connection) {
$tls->connect('www.google.com:443')->then(function (ConnectionInterface $connection) {
$connection->on('data', function ($data) {
echo $data;
});
Expand Down
6 changes: 3 additions & 3 deletions examples/03-netcat.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

require __DIR__ . '/../vendor/autoload.php';

if (!isset($argv[2])) {
fwrite(STDERR, 'Usage error: required arguments <host> <port>' . PHP_EOL);
if (!isset($argv[1])) {
fwrite(STDERR, 'Usage error: required argument <host:port>' . PHP_EOL);
exit(1);
}

Expand All @@ -33,7 +33,7 @@

$stderr->write('Connecting' . PHP_EOL);

$dns->create($argv[1], $argv[2])->then(function (ConnectionInterface $connection) use ($stdin, $stdout, $stderr) {
$dns->connect($argv[1])->then(function (ConnectionInterface $connection) use ($stdin, $stdout, $stderr) {
// pipe everything from STDIN into connection
$stdin->resume();
$stdin->pipe($connection);
Expand Down