3.3.4 socket.open()
Returns
Socket
手动打开socket
const socket=io({
autoConnect:false
})
// ...
socket.open()
它还可用于手动重新连接:
socket.on('disconnect',()=>{
socket.open()
})
Last updated
Was this helpful?
Returns Socket
手动打开socket
const socket=io({
autoConnect:false
})
// ...
socket.open()
它还可用于手动重新连接:
socket.on('disconnect',()=>{
socket.open()
})
Last updated
Was this helpful?