Skip to content

Commit dbc2e32

Browse files
committed
Use updated Factory
1 parent 7cdc5bf commit dbc2e32

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

example/client.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
$factory = new React\Dns\Resolver\Factory();
88
$resolver = $factory->createCached('8.8.8.8', $loop);
99

10-
$factory = new Datagram\Factory();
10+
$factory = new Datagram\Factory($loop, $resolver);
1111

12-
$factory->createClient($loop, $resolver, 'localhost', 1234)->then(function (Datagram\Client $client) use ($loop) {
12+
$factory->createClient('localhost', 1234)->then(function (Datagram\Client $client) use ($loop) {
1313
$client->send('first');
1414

1515
$client->on('message', function($message, $server) {

example/server.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
$loop = React\EventLoop\Factory::create();
66

7-
$factory = new Datagram\Factory();
7+
$factory = new Datagram\Factory($loop);
88

9-
$factory->createServer($loop, 1234)->then(function (Datagram\Server $server) {
9+
$factory->createServer(1234)->then(function (Datagram\Server $server) {
1010
$server->on('message', function($message, $client) {
1111
$client->send('hello '.$client->getAddress().'! echo: '.$message);
1212

0 commit comments

Comments
 (0)