Skip to content

Commit 7720ea8

Browse files
committed
README updates
1 parent 0c604a3 commit 7720ea8

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

README.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
## About
44

5-
This library has been tested with Ratchet WAMP server. It is based on the original WebSocketPhpClient and works with v2.0.0 of the GOS/Web-Socket-Bundle. It can only send messages to the server, listening for replies is not implemented.
5+
This package provides a PHP client that can send messages to a websocket server utilizing the WAMPv1 protocol. Listening for replies is not supported at this time.
6+
67
Supported functions:
78
- prefix
89
- call
@@ -14,28 +15,28 @@ Supported functions:
1415
```php
1516
use Gos\Component\WebSocketClient\Wamp\Client;
1617

17-
$client = new Client($host, $port);
18+
$client = new Client('127.0.0.1', '8080');
1819
$sessionId = $client->connect();
1920

20-
//establish a prefix on server
21+
// Establish a prefix on server
2122
$client->prefix("calc", "http://example.com/simple/calc#");
2223

23-
//you can send arbitrary number of arguments
24-
$client->call('calc', 12,14,15);
24+
// You can send an arbitrary number of arguments
25+
$client->call('calc', 12, 14, 15);
2526

2627
$data = [0, 1, 2];
2728

28-
//or array
29+
// Or an array
2930
$client->call('calc', $data);
3031

31-
$exclude = array($sessionId); //no sense in sending the payload to ourselves
32-
$eligible = [...] //list of other clients ids that are eligible to receive this payload
32+
$exclude = [$sessionId]; // No sense in sending the payload to ourselves
33+
$eligible = []; // List of other clients ids that are eligible to receive this payload
3334

34-
//$payload can be scalar or array
35-
$client->publish('topic', $payload, $exclude, $eligible);
35+
// $payload can be scalar or array
36+
$client->publish('topic', [], $exclude, $eligible);
3637

37-
//publish an event
38-
$client->event('topic', $payload);
38+
// Publish an event
39+
$client->event('topic', []);
3940
$client->disconnect();
4041
```
4142

0 commit comments

Comments
 (0)