parent
5b43c63c88
commit
16fca262be
@ -183,9 +183,10 @@ Socket.prototype._onTimeout = function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
Socket.prototype.setNoDelay = function() {
|
Socket.prototype.setNoDelay = function(enable) {
|
||||||
|
// backwards compatibility: assume true when `enable` is omitted
|
||||||
if (this._handle && this._handle.setNoDelay)
|
if (this._handle && this._handle.setNoDelay)
|
||||||
this._handle.setNoDelay();
|
this._handle.setNoDelay(typeof enable === 'undefined' ? true : !!enable);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -253,7 +253,8 @@ Handle<Value> TCPWrap::SetNoDelay(const Arguments& args) {
|
|||||||
|
|
||||||
UNWRAP
|
UNWRAP
|
||||||
|
|
||||||
int r = uv_tcp_nodelay(&wrap->handle_, 1);
|
int enable = static_cast<int>(args[0]->BooleanValue());
|
||||||
|
int r = uv_tcp_nodelay(&wrap->handle_, enable);
|
||||||
if (r)
|
if (r)
|
||||||
SetErrno(uv_last_error(uv_default_loop()));
|
SetErrno(uv_last_error(uv_default_loop()));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user