mirror of
https://gitee.com/hyperf/hyperf.git
synced 2024-12-05 05:07:58 +08:00
perf: only dispatch connect/disconnect events in onOpen and onClose
This commit is contained in:
parent
15072ff79b
commit
5f07edb28a
@ -157,11 +157,9 @@ class SocketIO implements OnMessageInterface, OnOpenInterface, OnCloseInterface
|
||||
'nsp' => $packet->nsp,
|
||||
]);
|
||||
$server->push($frame->fd, Engine::MESSAGE . $this->encoder->encode($responsePacket)); //sever open
|
||||
$this->dispatch($frame->fd, $packet->nsp, 'connect', $packet->data);
|
||||
break;
|
||||
case Packet::CLOSE: //client disconnect
|
||||
$server->disconnect($frame->fd);
|
||||
$this->dispatch($frame->fd, $packet->nsp, 'disconnect', $packet->data);
|
||||
break;
|
||||
case Packet::EVENT: // client message with ack
|
||||
if ($packet->id !== '') {
|
||||
|
Loading…
Reference in New Issue
Block a user