@@ -41,16 +41,14 @@ Once [installed](#install), you can use the following code to create a simple
4141echo server that listens for incoming multicast messages:
4242
4343``` php
44- $loop = React\EventLoop\Factory::create();
45- $factory = new Factory($loop);
44+ $factory = new Clue\React\Multicast\Factory();
4645$socket = $factory->createReceiver('224.10.20.30:4050');
4746
4847$socket->on('message', function ($data, $remote) use ($socket) {
4948 echo 'Sending back ' . strlen($data) . ' bytes to ' . $remote . PHP_EOL;
5049 $socket->send($data, $remote);
5150});
5251
53- $loop->run();
5452```
5553
5654See also the [ examples] ( examples ) .
@@ -60,13 +58,17 @@ See also the [examples](examples).
6058### Factory
6159
6260The ` Factory ` is responsible for creating your [ ` SocketInterface ` ] ( #socketinterface ) instances.
63- It also registers everything with the main [ ` EventLoop ` ] ( https://github.com/reactphp/event-loop#usage ) .
6461
6562``` php
66- $loop = React\EventLoop\Factory::create();
67- $factory = new Factory($loop);
63+ $factory = new Clue\React\Multicast\Factory();
6864```
6965
66+ This class takes an optional ` LoopInterface|null $loop ` parameter that can be used to
67+ pass the event loop instance to use for this object. You can use a ` null ` value
68+ here in order to use the [ default loop] ( https://github.com/reactphp/event-loop#loop ) .
69+ This value SHOULD NOT be given unless you're sure you want to explicitly use a
70+ given event loop instance.
71+
7072#### createSender()
7173
7274The ` createSender(): SocketInterface ` method can be used to
0 commit comments