socket.open()

  • Returns Socket

手动打开socket

const socket=io({
    autoConnect:false
})

// ...
socket.open()

它还可用于手动重新连接:

socket.on('disconnect',()=>{
    socket.open()
})

results matching ""

    No results matching ""