Skip to content

Commit 5f29b1f

Browse files
committed
Documentation
1 parent 55dea37 commit 5f29b1f

8 files changed

+23
-346
lines changed

README.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ It does not include convenience operations such as listeners and implicit error
1010

1111
## Documentation
1212

13-
- [Client overwiew](docs/Client.md)
14-
- [Server overview](docs/Server.md)
15-
- [Classes](docs/Classes/Classes.md)
13+
- [Client](docs/Client.md)
14+
- [Server](docs/Server.md)
1615
- [Examples](docs/Examples.md)
1716
- [Changelog](docs/Changelog.md)
1817
- [Contributing](docs/Contributing.md)
@@ -43,17 +42,18 @@ $client->close();
4342

4443
## Server
4544

46-
The library contains a websocket [server](docs/Server.md).
45+
The library contains a rudimentary single stream/single thread [server](docs/Server.md).
4746
It internally supports Upgrade handshake and implicit close and ping/pong operations.
48-
Preferred operation is using the listener function, but optional operations exist.
47+
48+
Note that it does **not** support threading or automatic association ot continuous client requests.
49+
If you require this kind of server behavior, you need to build it on top of provided server implementation.
4950

5051
```php
5152
$server = new WebSocket\Server();
52-
$server->listen(function ($message, $connection = null) {
53-
echo "Got {$message->getContent()}\n";
54-
if (!$connection) return; // Current connection is closed
55-
$connection->text('Sending message to client');
56-
});
53+
$server->accept();
54+
$message = $server->receive();
55+
$server->text($message);
56+
$server->close();
5757
```
5858

5959
### License and Contributors

docs/Changelog.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
99
### `1.6.0`
1010
* Connection separate from Client and Server (@sirn-se)
11-
* getPier() deprecated, replaces by getRemoteName() (@sirn-se)
12-
* Client accepts Psr\Http\Message\UriInterface as input for URI:s (@sirn-se)
11+
* getPier() deprecated, replaced by getRemoteName() (@sirn-se)
12+
* Client accepts `Psr\Http\Message\UriInterface` as input for URI:s (@sirn-se)
1313
* Bad URI throws exception when Client is instanciated, previously when used (@sirn-se)
14-
* Major internal refactoring (@sirn-se)
1514
* Preparations for multiple conection and listeners (@sirn-se)
15+
* Major internal refactoring (@sirn-se)
1616

1717
## `v1.5`
1818

docs/Classes/Client.md

-6
This file was deleted.

docs/Classes/Connection.md

-6
This file was deleted.

docs/Classes/Message.md

-6
This file was deleted.

docs/Classes/Server.md

-313
This file was deleted.

0 commit comments

Comments
 (0)