Skip to content

Documentation Improvements WRT Message Framing Through the xhr-polling Transport #8

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

Socket.IO protocol
==================

Expand Down Expand Up @@ -187,13 +186,20 @@ framing mechanisms for sending and receiving messages.

For `xhr-multipart`, the built-in MIME framing is used for the sake of consistency.

When no built-in lightweight framing is available, and multiple messages need to be
delivered (i.e: buffered messages), the following is used:
For transports like e.g. `xhr-polling`, where no built-in lightweight framing is
available, the following framing pattern is used when multiple messages need to be
delivered (i.e: buffered messages):

`\ufffd` [message lenth] `\ufffd`

Transports where the framing overhead is expensive (ie: when the xhr-polling
transport tries to send data to the server).
Example:
Consider the event-sequence `{"name":"abc","args":[1,2,3]}`,
`{"name":"utf8-test","args":["Iñtërnâtiônàlizætiøn"]}` was to be sent through the
`xhr-polling` transport.
A valid response body would then be:

\ufffd33\ufffd5:::{"name":"abc","args":[1,2,3]}\ufffd63\ufffd5:::{"name":"utf8-test","args":["Iñtërnâtiônàlizætiøn"]}


### Encoding

Expand Down