Skip to content
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

[CLOSED] Receive binary Brackets-Node command responses #5766

Open
core-ai-bot opened this issue Aug 30, 2021 · 2 comments
Open

[CLOSED] Receive binary Brackets-Node command responses #5766

core-ai-bot opened this issue Aug 30, 2021 · 2 comments

Comments

@core-ai-bot
Copy link
Member

Issue by iwehrman
Monday Dec 30, 2013 at 23:37 GMT
Originally opened as adobe/brackets#6339


This pull request updates NodeConnection so that it can receive binary responses to commands in Node domains. When a binary message --- i.e., an ArrayBuffer instance; i.e., an array of bytes; i.e., not a string to be interpreted as JSON --- is received via the WebSocket, the first four bytes are assumed to be a header and are interpreted as a (32-bit unsigned integer) command ID. The header is then stripped off and the pending deferred of the corresponding command is resolved with the remaining bytes. Clients can then interpret or process the bytes arbitrarily.

To ensure that the command ID can always be encoded as a 32-bit unsigned integer, IDs are now restricted to the range 0 <= id < 2^32. When the maximum value is eclipsed, the counter just rolls back to 0. (This could be improved, but the bugs in this PR already exist in the current implementation, so I'm not too worried about it.)

This should be reviewed in tandem with a companion brackets-shell pull request, adobe/brackets-shell#406, which allows domain commands to return binary responses.


iwehrman included the following code: https://github.com/adobe/brackets/pull/6339/commits

@core-ai-bot
Copy link
Member Author

Comment by jasonsanjose
Thursday Jan 09, 2014 at 00:04 GMT


Reviewed. Will merge after the next shell build to make sure the changes are picked up for the next unit test run.

@core-ai-bot
Copy link
Member Author

Comment by jasonsanjose
Thursday Jan 09, 2014 at 00:52 GMT


Merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant