From 5e6f3d7ab18367d5a482cbef37954993df98e085 Mon Sep 17 00:00:00 2001 From: Daniel Demiss Date: Tue, 15 Nov 2011 11:25:53 +0100 Subject: [PATCH 1/2] Clarified the framing mechanism for the `xhr-polling` transport and added an example with special Unicode points. --- README.md | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 9f42b9e..49c0c51 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,3 @@ - Socket.IO protocol ================== @@ -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"]}` wasto 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 From 728e527b2ddb9a4f1a18dce910fc8f72efd4281d Mon Sep 17 00:00:00 2001 From: Daniel Demiss Date: Tue, 15 Nov 2011 11:28:14 +0100 Subject: [PATCH 2/2] Fixed a typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 49c0c51..d57e847 100644 --- a/README.md +++ b/README.md @@ -194,7 +194,7 @@ delivered (i.e: buffered messages): Example: Consider the event-sequence `{"name":"abc","args":[1,2,3]}`, -`{"name":"utf8-test","args":["Iñtërnâtiônàlizætiøn"]}` wasto be sent through the +`{"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: