-
Notifications
You must be signed in to change notification settings - Fork 176
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
socket.write(byte[]) does not work #484
Comments
Yeah; because I never added automated tests for them, sockets gradually became broken and nobody noticed. I began fixing sockets in this PR, but ran out of time to completely fix them. I'd like to return to the PR sometime to get them in ship-shape. If you have any inclination to fix them yourself, let me know! I'd happily let you take over the PR. |
I would invest the time to take over the PR - but my experience is too weak. I will try to fix the socket stuff for my use case (quick & half blind & dirty) and will you keep informed what I did. |
This is my version of socketWrite0 which works well for me:
lines 8 to 12 were added/changed |
My code looks like:
This results into sending ONE byte (which is 0x00) instead of the FOUR bytes.
Having a look into websock.js I noticed a problem in the following function:
sQ is an empty array, while arr is an Uint8Array. Therefore sQ.concat(arr) results into an array with ONE entry which is the complete Uint8Array arr (and not in an array with 4 entries).
I changed the send function for my testing:
I think, that doppio should take care, that the parameter "arr" is of type array and not Unint8Array.
The text was updated successfully, but these errors were encountered: