Skip to content
Browse files

close mdm connection if it wasn't destroyed by a server disconnect

  • Loading branch information...
1 parent e14bc42 commit 597df873e82f76838026ac8fd4489c0640ca64d1 @Raynos committed Aug 10, 2012
Showing with 12 additions and 0 deletions.
  1. +12 −0 browser.js
View
12 browser.js
@@ -89,6 +89,12 @@ function reconnecter(uri) {
proxyMdmWrite.pipe(mdm).pipe(proxyMdmRead, {
end: false
})
+
+ mdm.once("end", function () {
+ if (!mdm.destroyed) {
+ proxyMdmRead.emit("end")
+ }
+ })
}
function createStream(meta, opts) {
@@ -106,6 +112,12 @@ function reconnecter(uri) {
end: false
})
+ mdm.once("end", function () {
+ if (!mdm.destroyed) {
+ proxyMdmRead.emit("end")
+ }
+ })
+
var index = metaStreams.push({
proxy: proxy
, proxyMdmRead: proxyMdmRead

0 comments on commit 597df87

Please sign in to comment.
Something went wrong with that request. Please try again.