success: (res) => {
console.log('PingSr:', new Date());
}
});
}
}
```
服务器回复:
```javascript
case 'answer': // 服务器回复pong
console.log('srPong!', data);
break;
```
客户端leave
```javascript
socket.send({type: 'leave'});
```
服务端心跳回复:Gateway::sendToCurrentClient(json_encode($new_message));
return;
```
服务端切换房间[](/upload/img/20230824/2464e76e935f24.png)
第一行为客户端心跳服务器
后面多行为服务端发来的数据:条数与房间数相同
不知为何,百思不得其姐!