Permalink
Browse files

eat EPIPEs

  • Loading branch information...
1 parent ef2e0e5 commit 4d9aecd64576a8e0f70fed88747e4a15ee5195f1 @substack committed Jun 20, 2012
Showing with 7 additions and 24 deletions.
  1. +0 −21 bin/bundle.js
  2. 0 {examples → example}/auth/client.js
  3. 0 {examples → example}/auth/quotes.json
  4. 0 {examples → example}/auth/server.js
  5. 0 {examples → example}/bidirectional/client.js
  6. 0 {examples → example}/bidirectional/server.js
  7. 0 {examples → example}/chat/INSTALL.txt
  8. 0 {examples → example}/chat/chat.css
  9. 0 {examples → example}/chat/entry.js
  10. 0 {examples → example}/chat/index.html
  11. 0 {examples → example}/chat/package.json
  12. 0 {examples → example}/chat/server.js
  13. 0 {examples → example}/https/index.html
  14. 0 {examples → example}/https/server.js
  15. 0 {examples → example}/nested.js
  16. 0 {examples → example}/perf/client.js
  17. 0 {examples → example}/perf/emitter.js
  18. 0 {examples → example}/pummel/client.js
  19. 0 {examples → example}/pummel/server.js
  20. 0 {examples → example}/saturate/index.html
  21. 0 {examples → example}/saturate/saturate.js
  22. 0 {examples → example}/simple/client.js
  23. 0 {examples → example}/simple/server.js
  24. 0 {examples → example}/stream/connect.js
  25. 0 {examples → example}/stream/listen.js
  26. 0 {examples → example}/web-browserify/index.html
  27. 0 {examples → example}/web-browserify/server.js
  28. 0 {examples/web-http → example/web-connect}/index.html
  29. 0 {examples → example}/web-connect/server.js
  30. 0 {examples → example}/web-express/index.html
  31. 0 {examples → example}/web-express/server.js
  32. 0 {examples/web-connect → example/web-http}/index.html
  33. 0 {examples → example}/web-http/server.js
  34. +6 −0 index.js
  35. +1 −3 package.json
View
@@ -1,21 +0,0 @@
-var fs = require('fs');
-var path = require('path');
-var browserify = require('browserify');
-
-var src = browserify({ filter : require('uglify-js') })
- .require(__dirname + '/../browser/index.js')
- .bundle()
-;
-
-var buf = new Buffer('var DNode = (function () {'
- + src + '; return require("/index.js")'
-+ '})()');
-
-var file = __dirname + '/../browser/bundle.js';
-fs.writeFile(file, buf, function (err) {
- if (err) console.error('Error: ' + err)
- else {
- var bytes = buf.length;
- console.log(bytes + ' bytes written');
- }
-});
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
View
@@ -56,6 +56,7 @@ D.prototype.connect = function () {
if (params.block) self.on('remote', params.block);
stream.on('error', function (err) {
+ if (err && err.code === 'EPIPE') return; // eat EPIPEs
self.emit('error', err);
});
@@ -95,6 +96,11 @@ dnode.prototype.listen = function () {
server.emit('remote', remote, d);
});
+ stream.on('error', function (err) {
+ if (err && err.code === 'EPIPE') return; // eat EPIPEs
+ d.emit('error', err);
+ });
+
d.stream = stream;
stream.pipe(d);
d.pipe(stream);
View
@@ -22,9 +22,7 @@
},
"devDependencies" : {
"tap" : "~0.2.4",
- "browserify" : "~1.10.7",
- "uglify-js" : "~1.2.5",
- "express" : "~2.5.9"
+ "browserify" : "~1.10.7"
},
"scripts" : {
"test" : "tap test/*.js"

0 comments on commit 4d9aecd

Please sign in to comment.