Answer the question
In order to leave comments, you need to log in
How to send a message on a server timer in Swoole, error 9009?
It is necessary to send to all connected once every X seconds. the same message.
In the object, during initialization, I save $this->server = new \Swoole\Server(...);
Configure, hang up listeners and start the server timer:
$this->server->tick(1000, function () {
$this->update();
});
foreach ($this->server->connections as $fd) {
$this->server->push($fd, $message);
}
[2020-05-05 12:23:56 #21985.2] ERROR swServer_tcp_send (ERRNO 9009):
can't send data to the connections in master process
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question