1
1
# clue/reactphp-multicast
2
2
3
- [ ![ CI status] ( https://github.com/clue/reactphp-multicast/workflows/CI /badge.svg )] ( https://github.com/clue/reactphp-multicast/actions )
3
+ [ ![ CI status] ( https://github.com/clue/reactphp-multicast/actions/ workflows/ci.yml /badge.svg )] ( https://github.com/clue/reactphp-multicast/actions )
4
4
[ ![ installs on Packagist] ( https://img.shields.io/packagist/dt/clue/multicast-react?color=blue&label=installs%20on%20Packagist )] ( https://packagist.org/packages/clue/multicast-react )
5
5
6
6
Simple, event-driven multicast UDP message client and server for [ ReactPHP] ( https://reactphp.org/ ) .
@@ -41,6 +41,10 @@ Once [installed](#install), you can use the following code to create a simple
41
41
echo server that listens for incoming multicast messages:
42
42
43
43
``` php
44
+ <?php
45
+
46
+ require __DIR__ . '/vendor/autoload.php';
47
+
44
48
$factory = new Clue\React\Multicast\Factory();
45
49
$socket = $factory->createReceiver('224.10.20.30:4050');
46
50
@@ -51,7 +55,7 @@ $socket->on('message', function ($data, $remote) use ($socket) {
51
55
52
56
```
53
57
54
- See also the [ examples] ( examples ) .
58
+ See also the [ examples] ( examples/ ) .
55
59
56
60
## Usage
57
61
@@ -114,7 +118,7 @@ This is a requirement because receiving multicast datagrams requires a
114
118
[ level 2 multicast conformant] ( https://www.tldp.org/HOWTO/Multicast-HOWTO-2.html#ss2.2 )
115
119
socket API.
116
120
The required multicast socket options and constants have been added with
117
- [ PHP 5.4] ( http ://php.net /manual/en/migration54.global-constants.php ) (and up).
121
+ [ PHP 5.4] ( https ://php-legacy-docs.zend.com /manual/php5/ en/migration54.new-features ) (and up).
118
122
These options are only available to the low level socket API (ext-sockets), not
119
123
to the newer stream based networking API.
120
124
@@ -147,22 +151,22 @@ Please refer to the [datagram documentation](https://github.com/reactphp/datagra
147
151
148
152
## Install
149
153
150
- The recommended way to install this library is [ through Composer] ( https://getcomposer.org ) .
154
+ The recommended way to install this library is [ through Composer] ( https://getcomposer.org/ ) .
151
155
[ New to Composer?] ( https://getcomposer.org/doc/00-intro.md )
152
156
153
157
This project follows [ SemVer] ( https://semver.org/ ) .
154
158
This will install the latest supported version:
155
159
156
160
``` bash
157
- $ composer require clue/multicast-react:^1.1
161
+ composer require clue/multicast-react:^1.1
158
162
```
159
163
160
164
See also the [ CHANGELOG] ( CHANGELOG.md ) for details about version upgrades.
161
165
162
166
This project aims to run on any platform and thus does not require any PHP
163
167
extensions and supports running on legacy PHP 5.3 through current PHP 8+ and
164
168
HHVM.
165
- It's * highly recommended to use PHP 7+ * for this project.
169
+ It's * highly recommended to use the latest supported PHP version * for this project.
166
170
167
171
The [ ` createSender() ` ] ( #createsender ) method works on all supported platforms
168
172
without any additional requirements. However, the [ ` createReceiver() ` ] ( #createreceiver )
@@ -171,16 +175,16 @@ method requires PHP 5.4 (or up) and `ext-sockets`. See above for more details.
171
175
## Tests
172
176
173
177
To run the test suite, you first need to clone this repo and then install all
174
- dependencies [ through Composer] ( https://getcomposer.org ) :
178
+ dependencies [ through Composer] ( https://getcomposer.org/ ) :
175
179
176
180
``` bash
177
- $ composer install
181
+ composer install
178
182
```
179
183
180
184
To run the test suite, go to the project root and run:
181
185
182
186
``` bash
183
- $ php vendor/bin/phpunit
187
+ php vendor/bin/phpunit
184
188
```
185
189
186
190
## License
0 commit comments