Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using namespaces with emitter #260

Open
mrkh995 opened this issue Jan 28, 2021 · 0 comments
Open

using namespaces with emitter #260

mrkh995 opened this issue Jan 28, 2021 · 0 comments

Comments

@mrkh995
Copy link

mrkh995 commented Jan 28, 2021

i have a php script

myserver.php :

use Workerman\Worker;
use PHPSocketIO\SocketIO;

require_once 'vendor/autoload.php';

$channel = new Channel\Server();
$io = new SocketIO(2022);

$io->on('workerStart', function()use($io){
    $io->adapter('\PHPSocketIO\ChannelAdapter');
});

$io->of('/one')->on('connection', function ($socket) use ($io) {
    // ...
});

$io->of('/two')->on('connection', function ($socket) use ($io) {
  // ...
});

Worker::runAll();
```php

i'm using an emitter php script to emit events to clients connected to /one or /two namespaces

it's working for namespace '/two' connected users ;but not for '/one'
and i get this error :
"ignore different namespace /one != /two"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants