Skip to content

Commit

Permalink
Don't mask exceptions in writeToSocket(); let the server catch them s…
Browse files Browse the repository at this point in the history
…o it can retry messages.
  • Loading branch information
jcoglan committed Jan 3, 2011
1 parent 26cee48 commit ecd7a48
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions javascript/util/node/web_socket.js
Expand Up @@ -164,14 +164,9 @@ Faye.extend(Faye.WebSocket, {
};

var writeToSocket = function(socket, message) {
try {
socket.write(FRAME_START, 'binary');
socket.write(message, 'utf8');
socket.write(FRAME_END, 'binary');
} catch (e) {
// socket closed while writing
// server will keep message and retry when a new socket is open
}
socket.write(FRAME_START, 'binary');
socket.write(message, 'utf8');
socket.write(FRAME_END, 'binary');
};

var FRAME_START = byteToChar('00'),
Expand Down

0 comments on commit ecd7a48

Please sign in to comment.