var FLAG_GOT_EOF = 1 << 0;
var FLAG_SHUTDOWN = 1 << 1;
var FLAG_DESTROY_SOON = 1 << 2;
-var FLAG_SHUTDOWNQUED = 1 << 3;
+var FLAG_SHUTDOWN_QUEUED = 1 << 3;
var debug;
Socket.prototype.end = function(data, encoding) {
- if (this._connecting && ((this._flags & FLAG_SHUTDOWNQUED) == 0)) {
+ if (this._connecting && ((this._flags & FLAG_SHUTDOWN_QUEUED) == 0)) {
// still connecting, add data to buffer
if (data) this.write(data, encoding);
this.writable = false;
- this._flags |= FLAG_SHUTDOWNQUED;
+ this._flags |= FLAG_SHUTDOWN_QUEUED;
}
if (!this.writable) return;
self.emit('connect');
- if (self._flags & FLAG_SHUTDOWNQUED) {
+ if (self._flags & FLAG_SHUTDOWN_QUEUED) {
// end called before connected - call end now with no data
- self._flags &= ~FLAG_SHUTDOWNQUED;
+ self._flags &= ~FLAG_SHUTDOWN_QUEUED;
self.end();
}
} else {