Skip to content

Commit

Permalink
do not throw on setNoDelay
Browse files Browse the repository at this point in the history
  • Loading branch information
anonrig committed Jan 14, 2025
1 parent c87e32c commit 46ede10
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/node/net.ts
Original file line number Diff line number Diff line change
Expand Up @@ -748,10 +748,11 @@ Socket.prototype.connect = function (

Socket.prototype.setNoDelay = function (
this: SocketClass,
enable?: boolean
_enable?: boolean
): SocketClass {
if (!enable) return this;
throw new ERR_INVALID_ARG_VALUE('enable', enable, 'is not supported');
// Ignore this for now.
// Cloudflare connect() does not support this.
return this;
};

Socket.prototype.setKeepAlive = function (
Expand Down Expand Up @@ -1330,7 +1331,6 @@ export function connect(...args: unknown[]): SocketClass {
const normalized = normalizeArgs(args);
const options = normalized[0] as SocketOptions;
// @ts-expect-error TS7009 Required for type usage

const socket: SocketClass = new Socket(options);
if (options.timeout) {
socket.setTimeout(options.timeout);
Expand Down

0 comments on commit 46ede10

Please sign in to comment.