code cleanup

This commit is contained in:
brianc 2010-10-10 22:44:13 -05:00
parent ac95c74c66
commit 6d4469e391

View File

@ -17,7 +17,9 @@ var Client = function(config) {
sys.inherits(Client, EventEmitter);
Client.prototype.connect = function() {
var p = Client.prototype;
p.connect = function() {
if(this.stream.readyState == 'closed'){
this.stream.connect(this.port, this.host);
}
@ -54,12 +56,12 @@ Client.prototype.connect = function() {
});
};
Client.prototype.disconnect = function() {
p.disconnect = function() {
var terminationBuffer = new Buffer([58,0,0,0,4]);
this.stream.write(terminationBuffer);
};
Client.prototype.query = function(text) {
p.query = function(text) {
var query = new Query();
query.client = this;
query.text = text;
@ -68,7 +70,7 @@ Client.prototype.query = function(text) {
return query;
};
Client.prototype.pulseQueryQueue = function() {
p.pulseQueryQueue = function() {
if(!this.readyForQuery) {
return;
};