Set noDelay to true

This commit is contained in:
Brian M. Carlson 2020-05-12 16:32:40 -05:00
parent 520bd35319
commit 08afb12dcc
3 changed files with 4 additions and 0 deletions

View File

@ -39,6 +39,7 @@ Connection.prototype.connect = function (port, host) {
var self = this
this._connecting = true
this.stream.setNoDelay(true)
this.stream.connect(port, host)
this.stream.once('connect', function () {

View File

@ -5,6 +5,7 @@ var Client = require(__dirname + '/../../../lib/client')
test('emits end when not in query', function () {
var stream = new (require('events').EventEmitter)()
stream.setNoDelay = () => {}
stream.connect = function () {
// NOOP
}

View File

@ -17,6 +17,8 @@ p.connect = function () {
// NOOP
}
p.setNoDelay = () => {}
p.write = function (packet, cb) {
this.packets.push(packet)
if (cb) {