我在Node.js服务器上使用Socket.io。
for (connectedSocket of io.sockets.sockets) {
console.log(`TEST: id = ${connectedSocket.id}`) //Why is this 'undefined'? All I want is the unique identifier of each socket in the server.
}不确定如何解决这个问题,但它必须非常简单。很抱歉,代码格式化失败:o
https://stackoverflow.com/questions/69819193
复制相似问题