Skip to content

Commit e0df7cc

Browse files
committed
Add some comments
1 parent 55e8268 commit e0df7cc

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

examples/Application/Chat.php

+5
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ public function onData(string $data, Connection $client): void
7575
}
7676
}
7777

78+
/**
79+
* Handles data pushed into the websocket server using the push-client.
80+
*
81+
* @param array $data
82+
*/
7883
public function onIPCData(array $data): void
7984
{
8085
$actionName = 'action' . ucfirst($data['action']);

examples/push.php

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
require __DIR__ . '/../src/IPCPayloadFactory.php';
55
require __DIR__ . '/../src/PushClient.php';
66

7+
/**
8+
* This code shows how to push data into the running websocket server.
9+
* In this case a system message is sent to the chat demo application.
10+
*/
11+
712
$pushClient = new \Bloatless\WebSocket\PushClient('//tmp/phpwss.sock');
813
$pushClient->sendToApplication('chat', [
914
'action' => 'echo',

examples/server.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
$server->setAllowedOrigin('foo.lh');
2222
$server->setMaxConnectionsPerIp(100);
2323

24-
// Hint: Status application should not be removed as it displays usefull server informations:
24+
// add your applications
2525
$server->registerApplication('status', \Bloatless\WebSocket\Application\StatusApplication::getInstance());
2626
$server->registerApplication('chat', \Bloatless\WebSocket\Examples\Application\Chat::getInstance());
2727

0 commit comments

Comments
 (0)