Skip to content

Commit

Permalink
Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
sirn-se committed Oct 29, 2022
1 parent 55dea37 commit 5f29b1f
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 346 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ It does not include convenience operations such as listeners and implicit error

## Documentation

- [Client overwiew](docs/Client.md)
- [Server overview](docs/Server.md)
- [Classes](docs/Classes/Classes.md)
- [Client](docs/Client.md)
- [Server](docs/Server.md)
- [Examples](docs/Examples.md)
- [Changelog](docs/Changelog.md)
- [Contributing](docs/Contributing.md)
Expand Down Expand Up @@ -43,17 +42,18 @@ $client->close();

## Server

The library contains a websocket [server](docs/Server.md).
The library contains a rudimentary single stream/single thread [server](docs/Server.md).
It internally supports Upgrade handshake and implicit close and ping/pong operations.
Preferred operation is using the listener function, but optional operations exist.

Note that it does **not** support threading or automatic association ot continuous client requests.
If you require this kind of server behavior, you need to build it on top of provided server implementation.

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

### License and Contributors
Expand Down
6 changes: 3 additions & 3 deletions docs/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
### `1.6.0`
* Connection separate from Client and Server (@sirn-se)
* getPier() deprecated, replaces by getRemoteName() (@sirn-se)
* Client accepts Psr\Http\Message\UriInterface as input for URI:s (@sirn-se)
* getPier() deprecated, replaced by getRemoteName() (@sirn-se)
* Client accepts `Psr\Http\Message\UriInterface` as input for URI:s (@sirn-se)
* Bad URI throws exception when Client is instanciated, previously when used (@sirn-se)
* Major internal refactoring (@sirn-se)
* Preparations for multiple conection and listeners (@sirn-se)
* Major internal refactoring (@sirn-se)

## `v1.5`

Expand Down
6 changes: 0 additions & 6 deletions docs/Classes/Client.md

This file was deleted.

6 changes: 0 additions & 6 deletions docs/Classes/Connection.md

This file was deleted.

6 changes: 0 additions & 6 deletions docs/Classes/Message.md

This file was deleted.

313 changes: 0 additions & 313 deletions docs/Classes/Server.md

This file was deleted.

Loading

0 comments on commit 5f29b1f

Please sign in to comment.