3.3.2 socket.connected
(Boolean)
socket是否连接到服务器。
const socket= io('http://localhost');
socket.on('connect',()=>{
console.log(socket.connected) //true
})
Last updated
Was this helpful?
(Boolean)
socket是否连接到服务器。
const socket= io('http://localhost');
socket.on('connect',()=>{
console.log(socket.connected) //true
})
Last updated
Was this helpful?