Permalink
Browse files

Remove socket.writable assertions.

We handle write failures by buffering data until
the next write or drain event.
  • Loading branch information...
reid committed Aug 28, 2012
1 parent 96b5f20 commit 2fe656c685a211ec3791f2372bb23a1354d6a9ac
Showing with 0 additions and 12 deletions.
  1. +0 −12 lib/blizzard/session.js
View
@@ -259,16 +259,6 @@ BlizzardSession.prototype._socketWrite = function (data) {
}
};
-/**
- * Returns true if the socket is writable.
- *
- * @method socketReady
- * @return {Boolean} True if ready, false otherwise.
- */
-BlizzardSession.prototype.socketReady = function () {
- return this.socket && this.socket.writable;
-};
-
/**
* Transfer a zero-length packet.
*
@@ -278,7 +268,6 @@ BlizzardSession.prototype.socketReady = function () {
* @param {Number} id Message ID. Must be a 32-bit integer.
*/
BlizzardSession.prototype.xferRawZeroLength = function (type, id) {
- assert(this.socketReady(), "Socket not writable.");
assert(!isNaN(id), "ID must be a number.");
var header = new Buffer(10);
@@ -300,7 +289,6 @@ BlizzardSession.prototype.xferRawZeroLength = function (type, id) {
* @param {Buffer} buffer Packet payload.
*/
BlizzardSession.prototype.xferRaw = function (type, id, buffer) {
- assert(this.socketReady(), "Socket not writable.");
assert(!isNaN(id), "ID must be a number.");
assert(Buffer.isBuffer(buffer), "Buffer required.");

0 comments on commit 2fe656c

Please sign in to comment.