Skip to content

Latest commit

 

History

History
23 lines (16 loc) · 236 Bytes

socket_open.md

File metadata and controls

23 lines (16 loc) · 236 Bytes

socket.open()

  • Returns Socket

手动打开socket

const socket=io({
    autoConnect:false
})

// ...
socket.open()

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

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