You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+24Lines changed: 24 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,13 +50,37 @@ $factory = new Factory($loop);
50
50
51
51
The `createSender()` method can be used to create a socket capable of sending outgoing multicast datagrams and receiving incoming unicast responses. It returns a [`Socket`](#socket) instance.
52
52
53
+
```php
54
+
$socket = $factory->createSender();
55
+
56
+
// send a multicast message to everybody listening on the given address
57
+
$socket->send('hello?', '224.10.20.30:4050');
58
+
59
+
// report incoming unicast replies
60
+
$socket->on('message', function ($data, $address) {
The `createSender($address)` method can be used to create a socket capable of receiving incoming multicast datagrams and sending outgoing unicast or multicast datagrams. It returns a [`Socket`](#socket) instance.
0 commit comments