Skip to content

Commit 18dcf08

Browse files
committed
Remove use cases in examples
1 parent adba1af commit 18dcf08

File tree

6 files changed

+9
-20
lines changed

6 files changed

+9
-20
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Once [installed](#install), you can use the following code to create a simple
4141
echo server that listens for incoming multicast messages:
4242

4343
```php
44-
$factory = new Factory();
44+
$factory = new Clue\React\Multicast\Factory();
4545
$socket = $factory->createReceiver('224.10.20.30:4050');
4646

4747
$socket->on('message', function ($data, $remote) use ($socket) {
@@ -60,7 +60,7 @@ See also the [examples](examples).
6060
The `Factory` is responsible for creating your [`SocketInterface`](#socketinterface) instances.
6161

6262
```php
63-
$factory = new Factory();
63+
$factory = new Clue\React\Multicast\Factory();
6464
```
6565

6666
This class takes an optional `LoopInterface|null $loop` parameter that can be used to

examples/dump-received.php

+2-5
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
* Accepts a single argument socket address (defaults to 224.10.20.30:12345)
66
*/
77

8-
use Clue\React\Multicast\Factory;
9-
use Clue\Hexdump\Hexdump;
10-
118
require __DIR__ . '/../vendor/autoload.php';
129

1310
$address = '224.10.20.30:12345'; // random test address
@@ -18,9 +15,9 @@
1815
$address = $argv[1];
1916
}
2017

21-
$factory = new Factory();
18+
$factory = new Clue\React\Multicast\Factory();
2219
$socket = $factory->createReceiver($address);
23-
$hex = new Hexdump();
20+
$hex = new Clue\Hexdump\Hexdump();
2421

2522
$socket->on('message', function ($data, $remote) use ($hex) {
2623
echo 'Received from ' . $remote . PHP_EOL;

examples/echo-received.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
* Accepts a single argument socket address (defaults to 224.10.20.30:12345)
66
*/
77

8-
use Clue\React\Multicast\Factory;
9-
108
require __DIR__ . '/../vendor/autoload.php';
119

1210
$address = '224.10.20.30:12345'; // random test address
@@ -17,7 +15,7 @@
1715
$address = $argv[1];
1816
}
1917

20-
$factory = new Factory();
18+
$factory = new Clue\React\Multicast\Factory();
2119
$socket = $factory->createReceiver($address);
2220

2321
$socket->on('message', function ($data, $remote) use ($socket) {

examples/send-once.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@
55
* Accepts a single argument socket address (defaults to 224.10.20.30:12345)
66
*/
77

8-
use Clue\React\Multicast\Factory;
9-
108
require __DIR__ . '/../vendor/autoload.php';
119

1210
$address = isset($argv[1]) ? $argv[1] : '224.10.20.30:12345';
1311

14-
$factory = new Factory();
12+
$factory = new Clue\React\Multicast\Factory();
1513
$sender = $factory->createSender();
1614

1715
// do not wait for incoming messages

examples/send-wait.php

+2-5
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,13 @@
55
* Accepts a single argument socket address (defaults to 224.10.20.30:12345)
66
*/
77

8-
use Clue\React\Multicast\Factory;
9-
use Clue\Hexdump\Hexdump;
10-
118
require __DIR__ . '/../vendor/autoload.php';
129

1310
$address = isset($argv[1]) ? $argv[1] : '224.10.20.30:12345';
1411

15-
$factory = new Factory();
12+
$factory = new Clue\React\Multicast\Factory();
1613
$sender = $factory->createSender();
17-
$hex = new Hexdump();
14+
$hex = new Clue\Hexdump\Hexdump();
1815

1916
// print a hexdump of every message received
2017
$sender->on('message', function ($data, $remote) use ($hex) {

examples/ssdp.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@
33
* UPnP simple service discovery protocol (SSDP)
44
*/
55

6-
use Clue\React\Multicast\Factory;
76

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

109
$address = '239.255.255.250:1900';
1110

12-
$factory = new Factory();
11+
$factory = new Clue\React\Multicast\Factory();
1312
$sender = $factory->createSender();
1413

1514
// dump all incoming messages

0 commit comments

Comments
 (0)