We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b170e7e commit a686bfeCopy full SHA for a686bfe
example/client.php
@@ -12,14 +12,12 @@
12
$factory->createClient('localhost', 1234)->then(function (Datagram\Socket $client) use ($loop) {
13
$client->send('first');
14
15
- $client->on('message', function($message, $server) {
16
- //$remote->send() is same as $client->send()
17
-
18
- echo 'received "' . $message . '" from ' . $server. PHP_EOL;
+ $client->on('message', function($message, $serverAddress, $client) {
+ echo 'received "' . $message . '" from ' . $serverAddress. PHP_EOL;
19
});
20
21
- $client->on('error', function($error, $server) {
22
- echo 'error from ' . $server . PHP_EOL;
+ $client->on('error', function($error, $client) {
+ echo 'error: ' . $error->getMessage() . PHP_EOL;
23
24
25
$n = 0;
0 commit comments