Permalink
Browse files

Fix for `stream not writable` problems

  • Loading branch information...
rauchg committed May 28, 2010
1 parent 3134940 commit 0ad237ddf544fcecc9e0e0d68ff89a3f5c490f59
Showing with 7 additions and 3 deletions.
  1. +7 −3 lib/socket.io/transports/websocket.js
@@ -55,9 +55,13 @@ this.websocket = Client.extend({
},
_write: function(message){
- this.connection.write('\u0000', 'binary');
- this.connection.write(message, 'utf8');
- this.connection.write('\uffff', 'binary');
+ try {
+ this.connection.write('\u0000', 'binary');
+ this.connection.write(message, 'utf8');
+ this.connection.write('\uffff', 'binary');
+ } catch(){
+ this._onClose();
+ }
}
});

0 comments on commit 0ad237d

Please sign in to comment.