Skip to content

Commit

Permalink
Added example usage to readme for isRoute and hasRoute methods
Browse files Browse the repository at this point in the history
  • Loading branch information
diloabininyeri committed Feb 4, 2024
1 parent d5219fa commit a7557c7
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions readme.MD
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,39 @@ socket.onmessage = function (ev) {

```

**is Route and hasRoute methods**


1. **hasRoute:**
Is there any client connecting via /chat route?.

2. **isRoute:**
Is the current client connected via the /chat route?.



```php
class Handler extends AbstractSocketClientHandler
{

/**
*/
#[Override]
public function run(): void
{
$this->hasRoute('/chat');//Is there any client connecting via /chat route?
$this->isRoute('/chat'); //Is the current client connected via the /chat route?
}
}


$socketServer = new SocketServer(Handler::class);
$socketServer->serve(
'0.0.0.0',
8080
);
```

### The host address of the client
Let's disconnect the socket connection of an ip address
<br/>
Expand Down

0 comments on commit a7557c7

Please sign in to comment.