当前位置: 动力学知识库 > 问答 > 编程问答 >

node.js - socket.io upgrade returns a different socket.id

问题描述:

I have just upgraded from 1.3.7 to 1.4.5. I since noticed a difference in the socket.id. For example, prior to the upgrade, socket.id would be something like "K8JxW0Hy3djMo-GYAAAC". After the upgrade, socket.id is now something like "/#K8JxW0Hy3djMo-GYAAAC".

As my application is checking socket.id, the app now crashes. I am wondering, from a high level, if anyone knows why this is?

My initial suspicion was that it was concatenating the namespace, as I use the default "/", but that did not lead me very far.

At no point in my app is the socket.id being updated etc, it is only ever retrieved. It is a sizable app, hence the lack of code in the post.

网友答案:

I have since reverted back to the old version of socketio and the issue is not present, confirming it is an change put in a later version. I could not find any docs on this exactly, but as I am using default namespace "/", my optimistic self thinks that this is what is being added.

Please comment if anyone find docs to confirm why this has changed.

分享给朋友:
您可能感兴趣的文章:
随机阅读: