Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

also buffer .end()

  • Loading branch information...
commit 6ba04ffb0f30ab96a06dcea87d3f58393deaf1e3 1 parent 2e60d4c
@substack authored
Showing with 6 additions and 1 deletion.
  1. +5 −0 browser.js
  2. +1 −1  package.json
View
5 browser.js
@@ -28,6 +28,10 @@ module.exports = function (uri, cb) {
};
stream.end = function (msg) {
if (msg !== undefined) stream.write(msg);
+ if (!ready) {
+ stream._ended = true;
+ return;
+ }
stream.writable = false;
sock.close();
};
@@ -39,6 +43,7 @@ module.exports = function (uri, cb) {
sock.send(msg);
});
buffer = [];
+ if (stream._ended) stream.end();
};
sock.onmessage = function (e) {
stream.emit('data', e.data);
View
2  package.json
@@ -1,6 +1,6 @@
{
"name" : "shoe",
- "version" : "0.0.1",
+ "version" : "0.0.2",
"description" : "streaming sockjs for node and the browser",
"main" : "index.js",
"browserify" : "browser.js",
Please sign in to comment.
Something went wrong with that request. Please try again.