eof -> end

This commit is contained in:
Ryan Dahl 2010-02-01 18:19:08 -08:00
parent 4f56d8ae24
commit 33509bdbe5
3 changed files with 6 additions and 6 deletions

View File

@ -370,7 +370,7 @@ function newParser (type) {
};
parser.onMessageComplete = function () {
parser.incoming.emit("eof");
parser.incoming.emit("end");
};
}
return parser;
@ -392,7 +392,7 @@ function connectionListener (socket) {
});
// is this really needed?
socket.addListener('eof', function () {
socket.addListener('end', function () {
parser.finish();
// unref the parser for easy gc
freeParser(parser);

View File

@ -113,7 +113,7 @@ function Socket (peerInfo) {
if (!recvMsg.fd && bytesRead == 0) {
self.readable = false;
self._readWatcher.stop();
self.emit('eof');
self.emit('end');
if (!self.writable) self.forceClose();
} else if (bytesRead > 0) {
var start = recvBuffer.used;
@ -266,10 +266,10 @@ Socket.prototype.send = function (data, encoding) {
} else {
// data is a process.Buffer
// walk through the sendQueue, find the first empty buffer
var inserted = false;
//var inserted = false;
data.sent = 0;
data.used = data.length;
if (!inserted) self.sendQueue.push(data);
self.sendQueue.push(data);
self.sendQueueSize += data.used;
}
return this.flush();

View File

@ -29,7 +29,7 @@ function pingPongTest (port, host) {
}
});
socket.addListener("eof", function () {
socket.addListener("end", function () {
assert.equal(true, socket.writable);
assert.equal(false, socket.readable);
socket.close();