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

onConnect中无法推送消息 #39

Closed
zhigge opened this issue Jan 6, 2020 · 1 comment
Closed

onConnect中无法推送消息 #39

zhigge opened this issue Jan 6, 2020 · 1 comment

Comments

@zhigge
Copy link

zhigge commented Jan 6, 2020

public function onConnect($connection)
    {
        echo "new connection from ip " . $connection->getRemoteIp() . "\n";
        $connection->send('receive success');
    }
    public function onMessage($connection, $data)
    {
         $connection->send($data);
    }

onMessage可以发送消息;onConnect无法推送消息,但是在客户端cli可以打印IP

@leethrun
Copy link

$connection 有哪些可以调用的方法

@yunwuxin yunwuxin closed this as not planned Won't fix, can't repro, duplicate, stale Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants