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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@ outgoing unicast or multicast datagrams. It returns a [`SocketInterface`](#socke
```php
$socket = $factory->createReceiver('224.10.20.30:4050');

// report incoming multicast messages
// report incoming multicast messages
$socket->on('message', function ($data, $remote) use ($socket) {
echo 'Sending back ' . strlen($data) . ' bytes to ' . $remote . PHP_EOL;

// send a unicast reply to the remote
$socket->send($data, $remote);
});
Expand Down
3 changes: 1 addition & 2 deletions examples/dump-received.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
require __DIR__ . '/../vendor/autoload.php';

$address = '224.10.20.30:12345'; // random test address
//$address = '239.255.255.250:1900'; // UPNP SSDP (simple service discovery protocol)
//$address = '239.255.255.250:1900'; // UPnP SSDP (simple service discovery protocol)

// use either above default address or the one given as first argument to this script
if (isset($argv[1])) {
Expand All @@ -23,4 +23,3 @@
echo 'Received from ' . $remote . PHP_EOL;
echo $hex->dump($data) . PHP_EOL;
});

2 changes: 1 addition & 1 deletion examples/echo-received.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
require __DIR__ . '/../vendor/autoload.php';

$address = '224.10.20.30:12345'; // random test address
//$address = '239.255.255.250:1900'; // UPNP SSDP (simple service discovery protocol)
//$address = '239.255.255.250:1900'; // UPnP SSDP (simple service discovery protocol)

// use either above default address or the one given as first argument to this script
if (isset($argv[1])) {
Expand Down
5 changes: 3 additions & 2 deletions examples/ssdp.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?php
/**
* UPnP simple service discovery protocol (SSDP)
*
* See also https://github.com/clue/reactphp-ssdp
*/


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

$address = '239.255.255.250:1900';
Expand All @@ -18,7 +19,7 @@
});

// stop waiting for incoming messages after 3.0s (MX is 2s)
Loop::addTimer(3.0, function () use ($sender) {
React\EventLoop\Loop::addTimer(3.0, function () use ($sender) {
$sender->pause();
});

Expand Down