File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -322,6 +322,39 @@ socket.onmessage = function (ev) {
322322
323323```
324324
325+ ** is Route and hasRoute methods**
326+
327+
328+ 1 . ** hasRoute:**
329+ Is there any client connecting via /chat route?.
330+
331+ 2 . ** isRoute:**
332+ Is the current client connected via the /chat route?.
333+
334+
335+
336+ ``` php
337+ class Handler extends AbstractSocketClientHandler
338+ {
339+
340+ /**
341+ */
342+ #[Override]
343+ public function run(): void
344+ {
345+ $this->hasRoute('/chat');//Is there any client connecting via /chat route?
346+ $this->isRoute('/chat'); //Is the current client connected via the /chat route?
347+ }
348+ }
349+
350+
351+ $socketServer = new SocketServer(Handler::class);
352+ $socketServer->serve(
353+ '0.0.0.0',
354+ 8080
355+ );
356+ ```
357+
325358### The host address of the client
326359Let's disconnect the socket connection of an ip address
327360<br />
You can’t perform that action at this time.
0 commit comments