-
-
Notifications
You must be signed in to change notification settings - Fork 314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
socketcluster compliance #595
Comments
Thanks for this thorough description. About your problem. Since you are using different versions of the SC client and server, I would expect your package manager (e.g. npm or yarn) to point to two different versions of the |
Thanks too for your quick answer my ws dependency is setup like this. ` ├─┬ [email protected] Client and server actualy not share the same version of ws. note my issue is only on ping pong process. I understand the raw thing maybe you can restrict the change like this serversocket.js
134d133
< let messagePong = Buffer.from(messageBuffer).toString();
137c136
< let isPong = messagePong === pongMessage;
---
> let isPong = message === pongMessage; in order to identify each time the ping correctly |
@SSANSH OK. You could consider either downgrading socketcluster-client to an older version which uses an older ws module or upgrading it. Also, did you set the You need to do this if using an older client with a new version of the server as the new server versions default to protocolVersion 2 which old clients don't fully understand (the difference is related to the ping format so could be related to your issue). |
I work with a server in version [email protected] (why its not available on tags of repository).
And a client on version [email protected]
I have issue with following code :
`
// Receive incoming raw messages
this.socket.on('message', async (messageBuffer, isBinary) => {
let message = isBinary ? messageBuffer : messageBuffer.toString();
this.inboundReceivedMessageCount++;
`
problem is that isBinary function is not implemented on ws link to the version of the client [email protected]
Thats means when pong arrive isBinary is set to false
and we cannot validate the condition let isPong = message === pongMessage;
What to you think to change this code by :
`
// Receive incoming raw messages
this.socket.on('message', async (messageBuffer) => {
let message = Buffer.from(messageBuffer).toString();
this.inboundReceivedMessageCount++;
`
This will work on all case with and without isBinary.
or other option is to specify an option to keep the compliance with old client by running this code conditionnaly.
I know the best options is to update server and client, I will do this however this will be more easy to keep compliance during migration.
The text was updated successfully, but these errors were encountered: