Skip to content

Latest commit

 

History

History
15 lines (10 loc) · 283 Bytes

socket_id.md

File metadata and controls

15 lines (10 loc) · 283 Bytes

socket.id

  • (String)

socket会话的唯一标识符。在触发connect事件后设置,并在reconnect事件后更新。

const socket= io('http://localhost');

console.log(socket.id) //undefined

socket.on('connect',()=>{
    console.log(socket.id) // xxxx...
})